Skip to content

fix: add missing STRING_TO functions to the standard library (1.0.x) - #1904

Open
ghaith wants to merge 1 commit into
release/1.0.xfrom
rusty-backport-4659
Open

fix: add missing STRING_TO functions to the standard library (1.0.x)#1904
ghaith wants to merge 1 commit into
release/1.0.xfrom
rusty-backport-4659

Conversation

@ghaith

@ghaith ghaith commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Problem: STRING_TO_* conversions exist only for LINT, DINT, REAL and LREAL, and the integer variants accept the longest valid prefix instead of rejecting malformed input.

Solution: Move the lexer and the literal parsers into the plc_lexer and plc_parser crates so the standard library can reuse them, and add STRING_TO_* functions for BOOL, every integer and bit-string width, TIME, LTIME, DATE, DT and TOD that share one full-consumption parse rule. The date and time functions return the 64-bit nanosecond values used on this release line.

Backport of #1884 and #1899.

Refs: PRG-4659

🤖 Generated with Claude Code

Problem: STRING_TO_* conversions exist only for LINT, DINT, REAL and
LREAL, and the integer variants accept the longest valid prefix instead
of rejecting malformed input.

Solution: Move the lexer and the literal parsers into the plc_lexer and
plc_parser crates so the standard library can reuse them, and add
STRING_TO_* functions for BOOL, every integer and bit-string width, TIME,
LTIME, DATE, DT and TOD that share one full-consumption parse rule. The
date and time functions return the 64-bit nanosecond values used on this
release line.

Backport of #1884 and #1899.

Refs: PRG-4659

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@ghaith
ghaith requested review from mhasel and volsa September 2, 2026 07:30
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

Build Artifacts

🐧 Linux

Artifact Link Size
deb-x86_64 Download 13.3 MB
schema Download 0.0 MB
stdlib Download 40.9 MB
plc-x86_64 Download 43.5 MB
deb-aarch64 Download 6.5 MB
plc-aarch64 Download 43.3 MB

From workflow run

🪟 Windows

Artifact Link Size
stdlib.lib Download 5.4 MB
stdlib.dll Download 0.3 MB
plc.exe Download 38.3 MB

From workflow run

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant