Attempt to fix IecST numeric literals#2282
Conversation
|
@jneen Thanks for the mention, I will double check with my in-house experts and will provide insights as soon as I have them. |
|
@sjuergen Could you help here regarding numeric literals? |
|
@jneen I got this information from a colleague who is deep into ST:
And also this hint might be relevant, but probably obvious to you :)
Does that help? |
|
@jneen got some feedback from a team mate: the IEC61131-3 allows to spread underscores _ in between digits. Chapter 6.3.2 in Ed4 "Single underscore characters “_” inserted between the digits of a numeric literal shall not be significant." One -- but not more. And you can use them where ever you want. This is valid decimal integer: 1_23_456_7890. |
|
Thank you this is helpful! I think I can manage that. |
Before:

After:

@tali @bufferoverflow, are these changes correct? The sample file seems to indicate that these are valid literals, but the current lexer renders them as Error tokens.
Also, is there publicly available documentation on this syntax? I could only find this: https://webstore.iec.ch/en/publication/68533
which costs nearly CAD$900, far out of my budget for this project.