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> <artifactId>maven-resources-plugin</artifactId>
<version>2.6</version> <version>2.6</version>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-Xmx2048m -XX:MaxPermSize=256m</argLine>
</configuration>
</plugin>
<plugin> <plugin>
<artifactId>maven-eclipse-plugin</artifactId> <artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version> <version>2.9</version>

View File

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

View File

@@ -22,4 +22,15 @@ Select Case Percent
Case 76 To 100 Case 76 To 100
Case Else Case Else
Beep Beep
End Select End Select
Select Case Grade
Case "A"
Beep
Case Else
Beep
Case "B"
Beep
Case Else
Beep
End Select