higher precedence of ELSE in select statements

This commit is contained in:
uwol
2014-12-08 14:27:40 +01:00
parent e41795ab90
commit f91be4512f
3 changed files with 23 additions and 9 deletions

View File

@@ -70,6 +70,13 @@
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-Xmx2048m -XX:MaxPermSize=256m</argLine>
</configuration>
</plugin>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>

View File

@@ -409,7 +409,6 @@ seekStmt : SEEK WS valueStmt WS? ',' WS? valueStmt;
selectCaseStmt :
SELECT WS CASE WS valueStmt NEWLINE+
sC_Case*
sC_CaseElse?
WS? END_SELECT
;
@@ -418,17 +417,14 @@ sC_Case :
(block NEWLINE+)?
;
// ELSE first, so that it is not interpreted as a variable call
sC_Cond :
IS WS? comparisonOperator WS? valueStmt # caseCondIs
ELSE # caseCondElse
| IS WS? comparisonOperator WS? valueStmt # caseCondIs
| valueStmt (WS? ',' WS? valueStmt)* # caseCondValue
| INTEGERLITERAL WS TO WS valueStmt (WS? ',' WS? valueStmt)* # caseCondTo
;
sC_CaseElse :
CASE WS ELSE WS? (':'? NEWLINE* | NEWLINE+)
(block NEWLINE+)?
;
sendkeysStmt : SENDKEYS WS valueStmt (WS? ',' WS? valueStmt)?;
setattrStmt : SETATTR WS valueStmt WS? ',' WS? valueStmt;

View File

@@ -23,3 +23,14 @@ Select Case Percent
Case Else
Beep
End Select
Select Case Grade
Case "A"
Beep
Case Else
Beep
Case "B"
Beep
Case Else
Beep
End Select