Skip to content

Lexer errors with qualified enum literals and single-character string literals #216

Description

@manux81

Problem

While testing STruCpp with a broader IEC 61131-3 Structured Text test suite, I found two lexer issues.

1. Qualified enum literals

Given an enum type such as MachineState, expressions like:

IF Ok THEN
    TestQualifiedEnumLiteral := MachineState#STATE_RUN;
ELSE
    TestQualifiedEnumLiteral := MachineState#STATE_ERROR;
END_IF;

produce:
error: unexpected character: ->#<-

### 2. Single-character string literal
This expression:
```st
Pos := FIND(Result, 'o');
produce:
error: unxpected character: ->'<-


### Impact

_No response_

### Reproduction

[torture_test_core.txt](https://github.com/user-attachments/files/31261191/torture_test_core.txt)

### Code Locations

_No response_

### Fix

_No response_

### Acceptance

Check my attach!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions