Skip to content

Commit 5220279

Browse files
committed
restore unquoted relative directions as identifiers
1 parent 029ccd2 commit 5220279

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

src/main/antlr/sfml/SFML.g4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ label : (identifier) #RawLabel
150150

151151
emptyslots : EMPTY (SLOTS | SLOT) IN ;
152152

153-
identifier : (IDENTIFIER | REDSTONE | GLOBAL | SECOND | SECONDS) ;
153+
identifier : (IDENTIFIER | REDSTONE | GLOBAL | SECOND | SECONDS | TOP | BOTTOM | LEFT | RIGHT | FRONT | BACK) ;
154154

155155
// GENERAL
156156
string: STRING ;

src/test/java/ca/teamdman/sfml/SFMLTests.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,18 @@ public void quotedLabels() {
687687
);
688688
}
689689

690+
@Test
691+
public void relativeDirectionLabels() {
692+
assertNoCompileErrors(
693+
"""
694+
every 20 ticks do
695+
input from left right, null side
696+
output to right left, top side
697+
end
698+
"""
699+
);
700+
}
701+
690702
@Test
691703
public void basicResourceIdentifier() {
692704
var identifier = ResourceIdentifier.fromString("wool");

0 commit comments

Comments
 (0)