Commit 88b7f0f0 authored by John van Groningen's avatar John van Groningen
Browse files

rename label _Nothing as _None in the generated code, and _!Nothing,_#Nothing...

rename label _Nothing as _None in the generated code, and _!Nothing,_#Nothing and _|Nothing in the compiler to _!None,_#None and _|None
parent e3b8b74a
...@@ -113,7 +113,7 @@ LabDef unboxed_just_labels[5] = { ...@@ -113,7 +113,7 @@ LabDef unboxed_just_labels[5] = {
/*RealObj*/ {NULL, "", False, "_Justr", 0}, /*RealObj*/ {NULL, "", False, "_Justr", 0},
/*FileObj*/ {NULL, "", False, "_Justf", 0} /*FileObj*/ {NULL, "", False, "_Justf", 0}
}; };
LabDef nothing_lab = {NULL, "", False, "_Nothing", 0}; LabDef none_lab = {NULL, "", False, "_None", 0};
int unboxed_just_mark[5]; int unboxed_just_mark[5];
int unboxed_just_array_mark; int unboxed_just_array_mark;
...@@ -3651,7 +3651,7 @@ void generate_is_constructor (ImpRuleP rule) ...@@ -3651,7 +3651,7 @@ void generate_is_constructor (ImpRuleP rule)
break; break;
} }
case none_symb: case none_symb:
GenEqDesc (&nothing_lab,case_node->node_arity,0); GenEqDesc (&none_lab,case_node->node_arity,0);
break; break;
case just_symb: case just_symb:
{ {
...@@ -3659,7 +3659,7 @@ void generate_is_constructor (ImpRuleP rule) ...@@ -3659,7 +3659,7 @@ void generate_is_constructor (ImpRuleP rule)
symbol=case_node->node_symbol; symbol=case_node->node_symbol;
if (symbol->symb_head_strictness==OVERLOADED_CONS || symbol->symb_head_strictness>=UNBOXED_OVERLOADED_CONS){ if (symbol->symb_head_strictness==OVERLOADED_CONS || symbol->symb_head_strictness>=UNBOXED_OVERLOADED_CONS){
GenEqDesc (&nothing_lab,0,0); GenEqDesc (&none_lab,0,0);
GenNotB(); GenNotB();
} else } else
GenEqDesc (&just_lab,case_node->node_arity,0); GenEqDesc (&just_lab,case_node->node_arity,0);
...@@ -4561,7 +4561,7 @@ static int generate_code_for_switch_node (NodeP node,int asp,int bsp,struct esc ...@@ -4561,7 +4561,7 @@ static int generate_code_for_switch_node (NodeP node,int asp,int bsp,struct esc
matches_always=1; matches_always=1;
} else { } else {
if (symbol->symb_head_strictness==OVERLOADED_CONS || symbol->symb_head_strictness>=UNBOXED_OVERLOADED_CONS){ if (symbol->symb_head_strictness==OVERLOADED_CONS || symbol->symb_head_strictness>=UNBOXED_OVERLOADED_CONS){
GenEqDesc (&nothing_lab,0,asp-a_index); GenEqDesc (&none_lab,0,asp-a_index);
GenJmpFalse (&case_label); GenJmpFalse (&case_label);
} else { } else {
GenEqDesc (&just_lab,case_node->node_arity,asp-a_index); GenEqDesc (&just_lab,case_node->node_arity,asp-a_index);
...@@ -4574,7 +4574,7 @@ static int generate_code_for_switch_node (NodeP node,int asp,int bsp,struct esc ...@@ -4574,7 +4574,7 @@ static int generate_code_for_switch_node (NodeP node,int asp,int bsp,struct esc
GenJmp (&case_label); GenJmp (&case_label);
matches_always=1; matches_always=1;
} else { } else {
GenEqDesc (&nothing_lab,case_node->node_arity,asp-a_index); GenEqDesc (&none_lab,case_node->node_arity,asp-a_index);
GenJmpTrue (&case_label); GenJmpTrue (&case_label);
} }
break; break;
......
...@@ -21,7 +21,7 @@ extern LabDef ...@@ -21,7 +21,7 @@ extern LabDef
#if STRICT_LISTS #if STRICT_LISTS
conss_lab,consts_lab,conssts_lab,unboxed_cons_labels[5][2],unboxed_cons_array_label, conss_lab,consts_lab,conssts_lab,unboxed_cons_labels[5][2],unboxed_cons_array_label,
#endif #endif
just_lab, justs_lab, unboxed_just_array_label, unboxed_just_labels[5], nothing_lab, just_lab, justs_lab, unboxed_just_array_label, unboxed_just_labels[5], none_lab,
select_with_dictionary_lab, update_with_dictionary_lab, select_with_dictionary_lab, update_with_dictionary_lab,
CurrentAltLabel; CurrentAltLabel;
......
...@@ -3679,9 +3679,9 @@ static void FillNormalNode (Node node,int *asp_p,int *bsp_p,NodeId update_node_i ...@@ -3679,9 +3679,9 @@ static void FillNormalNode (Node node,int *asp_p,int *bsp_p,NodeId update_node_i
} }
if (update_node_id==NULL){ if (update_node_id==NULL){
*asp_p+=1; *asp_p+=1;
GenBuildh (&nothing_lab,0); GenBuildh (&none_lab,0);
} else } else
GenFillh (&nothing_lab,0,*asp_p-update_node_id->nid_a_index,node->node_state.state_kind == SemiStrict ? ReleaseAndFill : NormalFill); GenFillh (&none_lab,0,*asp_p-update_node_id->nid_a_index,node->node_state.state_kind == SemiStrict ? ReleaseAndFill : NormalFill);
return; return;
case string_denot: case string_denot:
GenBuildString (symb->symb_val); GenBuildString (symb->symb_val);
...@@ -4710,7 +4710,7 @@ void FillMatchNode (Node node,int *asp_p,int *bsp_p,NodeId update_node_id,CodeGe ...@@ -4710,7 +4710,7 @@ void FillMatchNode (Node node,int *asp_p,int *bsp_p,NodeId update_node_id,CodeGe
break; break;
case just_symb: case just_symb:
if (symbol->symb_head_strictness==OVERLOADED_CONS || symbol->symb_head_strictness>=UNBOXED_OVERLOADED_CONS){ if (symbol->symb_head_strictness==OVERLOADED_CONS || symbol->symb_head_strictness>=UNBOXED_OVERLOADED_CONS){
GenEqDesc (&nothing_lab,0,0); GenEqDesc (&none_lab,0,0);
GenNotB(); GenNotB();
} else } else
GenEqDesc (&just_lab,1,0); GenEqDesc (&just_lab,1,0);
......
...@@ -1044,9 +1044,9 @@ static void CodeNormalRootNode (Node root,NodeId rootid,int asp,int bsp,CodeGenN ...@@ -1044,9 +1044,9 @@ static void CodeNormalRootNode (Node root,NodeId rootid,int asp,int bsp,CodeGenN
if (resultstate.state_kind==StrictRedirection){ if (resultstate.state_kind==StrictRedirection){
GenPopA (asp); GenPopA (asp);
GenPopB (bsp); GenPopB (bsp);
GenBuildh (&nothing_lab,0); GenBuildh (&none_lab,0);
} else { } else {
GenFillh (&nothing_lab,0,asp,ReleaseAndFill); GenFillh (&none_lab,0,asp,ReleaseAndFill);
GenPopA (asp); GenPopA (asp);
GenPopB (bsp); GenPopB (bsp);
...@@ -1055,7 +1055,7 @@ static void CodeNormalRootNode (Node root,NodeId rootid,int asp,int bsp,CodeGenN ...@@ -1055,7 +1055,7 @@ static void CodeNormalRootNode (Node root,NodeId rootid,int asp,int bsp,CodeGenN
return; return;
} }
FillRhsRoot (&nothing_lab,root,asp,bsp,code_gen_node_ids_p); FillRhsRoot (&none_lab,root,asp,bsp,code_gen_node_ids_p);
return; return;
case apply_symb: case apply_symb:
#ifdef NEW_APPLY #ifdef NEW_APPLY
......
...@@ -37,10 +37,10 @@ predefined_idents ...@@ -37,10 +37,10 @@ predefined_idents
[PD_StrictJustSymbol] = i "_!Just", [PD_StrictJustSymbol] = i "_!Just",
[PD_UnboxedJustSymbol] = i "_#Just", [PD_UnboxedJustSymbol] = i "_#Just",
[PD_OverloadedJustSymbol] = i "_|Just", [PD_OverloadedJustSymbol] = i "_|Just",
[PD_NoneSymbol] = i "_Nothing", [PD_NoneSymbol] = i "_None",
[PD_StrictNoneSymbol] = i "_!Nothing", [PD_StrictNoneSymbol] = i "_!None",
[PD_UnboxedNoneSymbol] = i "_#Nothing", [PD_UnboxedNoneSymbol] = i "_#None",
[PD_OverloadedNoneSymbol] = i "_|Nothing", [PD_OverloadedNoneSymbol] = i "_|None",
[PD_UnitConsSymbol] = i "_Unit", [PD_UnitConsSymbol] = i "_Unit",
[PD_PredefinedModule] = i "_predefined", [PD_PredefinedModule] = i "_predefined",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment