Skip to content

Commit

Permalink
Bugfix: CURSOR is also SV (#341)
Browse files Browse the repository at this point in the history
  • Loading branch information
Claes65 authored Aug 4, 2023
1 parent 671fdce commit 6545262
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,11 @@ private void consumeAsteriskOrSystemVariable()
createAndAdd(SyntaxKind.CURRENT_UNIT);
return;
}
if (scanner.advanceIfIgnoreCase("CURSOR"))
{
createAndAdd(SyntaxKind.CURSOR);
return;
}
if (scanner.advanceIfIgnoreCase("CURS-COL"))
{
createAndAdd(SyntaxKind.CURS_COL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ public enum SyntaxKind
COUPLED(true, false, false),
CS(true, false, false),
CURRENT(true, false, false),
CURSOR(true, false, false),
CURSOR(true, true, false),
CV(false, false, false),
DATA(true, false, false),
DATAAREA(true, false, false),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ public class BuiltInFunctionTable
If you want to get all line numbers, including the `INCLUDE`s, use `*LINEX` instead.
""", INTEGER, 4.0),
unmodifiableVariable(SyntaxKind.ERROR_LINE, "Returns the line of the statement that raised an error", NUMERIC, 4),
unmodifiableVariable(SyntaxKind.CURSOR, """
Position of cursor on input screen at time ENTER or function key is pressed.
Note: It is recommended that the system variables *CURS-LINE and *CURS-COL be used instead of the *CURSOR command.
""", NUMERIC, 6),
unmodifiableVariable(SyntaxKind.CURS_FIELD, """
Returns the identification of the field in which the cursor is positioned" +
Can only be used together withe the `POS` function.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,12 @@ void lexMaxval()
assertTokens("*MAXVAL", token(SyntaxKind.MAXVAL, "*MAXVAL"));
}

@Test
void lexCursor()
{
assertTokens("*CURSOR", token(SyntaxKind.CURSOR, "*CURSOR"));
}

@Test
void lexCursLine()
{
Expand Down

0 comments on commit 6545262

Please sign in to comment.