aboutsummaryrefslogtreecommitdiff
path: root/src/boot/parser.boot
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2009-08-30 00:02:33 +0000
committerdos-reis <gdr@axiomatics.org>2009-08-30 00:02:33 +0000
commit9fecfc240728b7953537c2a2c837f7a420c274af (patch)
tree3f25889973d1c7d915b75ea752b429fca4b4fa39 /src/boot/parser.boot
parent3fc1f3a489b51d2e33830516b389ac63edb664a7 (diff)
downloadopen-axiom-9fecfc240728b7953537c2a2c837f7a420c274af.tar.gz
* boot/parser.boot ($sawParenthesizedHead): Remove.
(bpReturnType): Likewise. (bpBeginParameterList): Likewise. (bpEndParameterList): Likewise. (bpBeginDefinition): Likewise. (bpDefinition): Adjust. (bpVariable): Likewise.
Diffstat (limited to 'src/boot/parser.boot')
-rw-r--r--src/boot/parser.boot40
1 files changed, 5 insertions, 35 deletions
diff --git a/src/boot/parser.boot b/src/boot/parser.boot
index 52169219..eb070e8a 100644
--- a/src/boot/parser.boot
+++ b/src/boot/parser.boot
@@ -46,10 +46,6 @@ namespace BOOTTRAN
module parser
-++ true when the current function definition has its parameters
-++ written round parenthesis.
-$sawParenthesizedHead := false
-
bpFirstToken()==
$stok:=
if null $inputStream
@@ -842,15 +838,10 @@ bpExit()==
bpPush bfExit (bpPop2(),bpPop1()))
or true)
-++ returns true if the next token introduces a definition.
-bpBeginDefinition() ==
- bpEqPeek "DEF" or
- $sawParenthesizedHead and bpEqPeek "COLON"
-
bpDefinition()==
a:=bpState()
bpExit() =>
- bpBeginDefinition() =>
+ bpEqPeek "DEF" =>
bpRestore a
bpDef()
bpEqPeek "TDEF" =>
@@ -867,19 +858,8 @@ bpStoreName()==
$op := first $stack
$wheredefs := nil
$typings := nil
- $returnType := true -- assume we may return anything
true
-bpReturnType() ==
- -- a return type is acceptable for a function definition only
- -- if its parameters are written in round parenthesis.
- -- In particular, we reject the situation `foo x:Integer == ...'
- $sawParenthesizedHead and bpEqKey "COLON" =>
- bpApplication() or bpTrap()
- $returnType := bpPop1()
- true
- true
-
bpDef() ==
bpName() and bpStoreName() and bpDefTail()
@@ -893,9 +873,9 @@ bpSimpleDefinitionTail() ==
++ Parse the remaining of a compound definition.
bpCompoundDefinitionTail() ==
- bpVariable() and bpReturnType() and
- bpEqKey "DEF" and (bpWhere() or bpTrap())
- and bpPush %Definition(bpPop3(),bpPop2(),bpPop1())
+ bpVariable() and
+ bpEqKey "DEF" and (bpWhere() or bpTrap()) and
+ bpPush %Definition(bpPop3(),bpPop2(),bpPop1())
++ Parse the remainding of a definition. When we reach this point
@@ -1090,19 +1070,9 @@ bpBoundVariablelist()==
else bpColonName() and bpPush bfColonAppend(nil,bpPop1())
-++ Mark the start of parameter list enclosed in round parenthesis
-bpBeginParameterList() ==
- $sawParenthesizedHead := false
- true
-
-++ Mark the end of parameter list enclosed in round parenthesis
-bpEndParameterList() ==
- $sawParenthesizedHead := true
-
bpVariable()==
- bpBeginParameterList() and
bpParenthesized function bpBoundVariablelist and
- bpPush bfTupleIf bpPop1() and bpEndParameterList()
+ bpPush bfTupleIf bpPop1()
or bpBracketConstruct function bpPatternL
or bpName() or bpConstTok()