Skip to content

Commit

Permalink
revert allow FOREVER and NEVER
Browse files Browse the repository at this point in the history
  • Loading branch information
Depetrol committed Oct 8, 2024
1 parent eceb367 commit de7723c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
6 changes: 3 additions & 3 deletions core/src/main/java/org/lflang/LinguaFranca.xtext
Original file line number Diff line number Diff line change
Expand Up @@ -393,11 +393,11 @@ SignedInt:
;

Forever:
'forever' | 'FOREVER'
'forever'
;

Never:
'never' | 'NEVER'
'never'
;

Literal:
Expand Down Expand Up @@ -529,7 +529,7 @@ Token:
'startup' | 'shutdown' | 'after' | 'deadline' | 'mutation' | 'preamble' |
'new' | 'federated' | 'at' | 'as' | 'from' | 'widthof' | 'const' | 'method' |
'interleaved' | 'mode' | 'initial' | 'reset' | 'history' | 'watchdog' |
'extends' | 'forever' | 'FOREVER' | 'never' | 'NEVER' |
'extends' | 'forever' | 'never' |

// Other terminals
NEGINT | TRUE | FALSE |
Expand Down
10 changes: 4 additions & 6 deletions core/src/main/java/org/lflang/ast/ASTUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -948,22 +948,20 @@ public static boolean isZero(String literal) {
* Report whether the given literal is forever or not.
*
* @param literal AST node to inspect.
* @return True if the given literal denotes the constant {@code forever} or {@code FOREVER},
* false otherwise.
* @return True if the given literal denotes the constant {@code forever}, false otherwise.
*/
public static boolean isForever(String literal) {
return literal != null && (literal.equals("forever") || literal.equals("FOREVER"));
return literal != null && literal.equals("forever");
}

/**
* Report whether the given literal is never or not.
*
* @param literal AST node to inspect.
* @return True if the given literal denotes the constant {@code never} or {@code NEVER}, false
* otherwise.
* @return True if the given literal denotes the constant {@code never}, false otherwise.
*/
public static boolean isNever(String literal) {
return literal != null && (literal.equals("never") || literal.equals("NEVER"));
return literal != null && literal.equals("never");
}

/**
Expand Down

0 comments on commit de7723c

Please sign in to comment.