From c129ad817cd16aef92f5b433a509e15254b9ccd3 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Sat, 2 Aug 2008 10:21:14 +0000 Subject: * boot/parser.boot (bpTerm): Term forms depend on the kind of variable. (bpTypeItem): New. (bpTypeItemList): Use it. (bpTypeAliasDefition): Tidy. (bpCaseItem): Accept wildchars in pattern terms. * boot/ast.boot (bfCompDef): Don't name unused pattern variables. (bfSmintable): A character compares EQL. (bfCI): Ignore wildcard pattern variables. * boot/strap: Update cached Lisp translation. --- src/boot/parser.boot | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'src/boot/parser.boot') diff --git a/src/boot/parser.boot b/src/boot/parser.boot index abb743f7..87ade687 100644 --- a/src/boot/parser.boot +++ b/src/boot/parser.boot @@ -473,7 +473,7 @@ bpImport() == -- type-alias-definition: -- identifier <=> logical-expression bpTypeAliasDefition() == - (bpTerm() or bpTrap()) and + (bpTerm function bpIdList or bpTrap()) and bpEqKey "TDEF" and bpLogical() and bpPush %TypeAlias(bpPop2(), bpPop1()) @@ -1110,13 +1110,17 @@ bpStruct()== bpTypeList() and bpPush bfStruct(bpPop2(),bpPop1()) bpTypeList() == bpPileBracketed function bpTypeItemList - or bpTerm() and bpPush [bpPop1()] + or bpTerm function bpIdList and bpPush [bpPop1()] + +bpTypeItem() == + bpTerm function bpIdList -bpTypeItemList() == bpListAndRecover function bpTerm +bpTypeItemList() == + bpListAndRecover function bpTypeItem -bpTerm() == +bpTerm idListParser == (bpName() or bpTrap()) and - ((bpParenthesized function bpIdList and + ((bpParenthesized idListParser and bpPush bfNameArgs (bpPop2(),bpPop1())) or bpName() and bpPush bfNameArgs(bpPop2(),bpPop1())) or bpPush(bfNameOnly bpPop1()) @@ -1132,11 +1136,18 @@ bpCase()== bpPiledCaseItems()== bpPileBracketed function bpCaseItemList and bpPush bfCase(bpPop2(),bpPop1()) + bpCaseItemList()== bpListAndRecover function bpCaseItem + +bpCasePatternVar() == + bpName() or bpDot() + +bpCasePatternVarList() == + bpTuple function bpCasePatternVar bpCaseItem()== - (bpTerm() or bpTrap()) and + (bpTerm function bpCasePatternVarList or bpTrap()) and (bpEqKey "EXIT" or bpTrap()) and (bpWhere() or bpTrap()) and bpPush bfCaseItem (bpPop2(),bpPop1()) -- cgit v1.2.3