You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Front end: := on a UDT field in a single-line function body, and CRLF line endings #230
Both still reproduce on main (aebad8c). Pointers in case they help:
One-line body._parse_func_def and _parse_method_def read a single expression after => (parser.py#L921-L932, #L1050-L1061). _parse_arm_line (parser.py#L1204) already parses a one-line block, including a field target such as o.f := v, for switch arms. Using it for one-line function and method bodies should cover this; whatever reads is_single_expr may need a look.
CRLF. Only library sources are normalized (normalize_library_text, library_modules.py#L61-L67). Applying the same normalization to the main source at the top of _parse_bounded (init.py#L25-L33), before the pragma scan and the lexer, would cover it. Diagnostic line numbers don't change for \r\n.
Thank you for the report. Part 2 (CRLF): confirmed in the v1.7.0 source, \r is rejected by the lexer. This is not fixed in v1.7.0. A fix is being written: \r\n and a lone \r will be treated as a line break, with the same output and the same line numbers as the LF form. We expect to open the pull request on 2026-10-26. Part 1 (:= on a UDT field in a single-line function body): confirmed in the v1.7.0 source and not fixed in v1.7.0; we plan to open a pull request for it on 2026-10-30.
Update on part 2 (CRLF): the fix is up for review in #252. One precision to my earlier note: \r\n is folded to \n everywhere, including inside strings, and a lone \r ends a line in code and comments; a lone \r inside a string literal is kept as part of the string. Part 1 (:= on a UDT field in a single-line function body) is still planned for a pull request on 2026-10-30.
Part 2 (CRLF / lone CR line endings) is fixed by #252, merged to main; it ships in the next codegen release, 1.8.0 (I will confirm here when it is published).
Reopening, because part 1 (:= on a UDT field in a single-line function body) is not fixed yet: the merge closed this issue automatically. Part 1 is still planned for a pull request on 2026-10-30.
Verified both parts on main (11b5ca5, with engine 1.6.1): the := on a UDT field in a one-line function body now translates and runs, and the CRLF file from this issue now translates. Thank you for the fixes.
Activity
letiep97 commentedon Oct 20, 2026
Both still reproduce on main (
aebad8c). Pointers in case they help:_parse_func_defand_parse_method_defread a single expression after=>(parser.py#L921-L932, #L1050-L1061)._parse_arm_line(parser.py#L1204) already parses a one-line block, including a field target such aso.f := v, for switch arms. Using it for one-line function and method bodies should cover this; whatever readsis_single_exprmay need a look.normalize_library_text, library_modules.py#L61-L67). Applying the same normalization to the main source at the top of_parse_bounded(init.py#L25-L33), before the pragma scan and the lexer, would cover it. Diagnostic line numbers don't change for\r\n.luisleo526 commentedon Oct 25, 2026
Thank you for the report. Part 2 (CRLF): confirmed in the v1.7.0 source,
\ris rejected by the lexer. This is not fixed in v1.7.0. A fix is being written:\r\nand a lone\rwill be treated as a line break, with the same output and the same line numbers as the LF form. We expect to open the pull request on 2026-10-26. Part 1 (:=on a UDT field in a single-line function body): confirmed in the v1.7.0 source and not fixed in v1.7.0; we plan to open a pull request for it on 2026-10-30.luisleo526 commentedon Oct 25, 2026
Update on part 2 (CRLF): the fix is up for review in #252. One precision to my earlier note:
\r\nis folded to\neverywhere, including inside strings, and a lone\rends a line in code and comments; a lone\rinside a string literal is kept as part of the string. Part 1 (:=on a UDT field in a single-line function body) is still planned for a pull request on 2026-10-30.test: give the double-CRLF scripts a version directive (#230)
codegen: CRLF and lone CR line endings (#230, line-ending part) (#252)
luisleo526 commentedon Oct 25, 2026
Part 2 (CRLF / lone CR line endings) is fixed by #252, merged to main; it ships in the next codegen release, 1.8.0 (I will confirm here when it is published).
Reopening, because part 1 (
:=on a UDT field in a single-line function body) is not fixed yet: the merge closed this issue automatically. Part 1 is still planned for a pull request on 2026-10-30.docs: CHANGELOG: the planned 1.8.0 section with migration notes (#257)
codegen: five fixes for 1.8.0 (late restore, statement-order var init…
luisleo526 commentedon Oct 26, 2026
Both parts of this issue are fixed on main:
\r\nand a lone\rare line breaks, with the same output and line numbers as the LF form.:=on a UDT field in a single-line function or method body): codegen: five fixes for 1.8.0 (late restore, statement-order var initialization, request.currency_rate, helper-local var color, one-line field assignment) #261 (the parser change originally proposed as parser: a UDT field assignment as a one-line function or method body (Part of #230) #253).set(State s) => s.value := 1now translates like the same body on its own indented line. A plain-name or subscript target in a one-line body keeps its parser error, as before.Both ship in codegen 1.8.0. Closing this issue as fixed on main; I will confirm here when 1.8.0 is published.
luisleo526 commentedon Oct 26, 2026
Both parts of this issue are fixed on main:
\r\nand a lone\rare line breaks, with the same output and line numbers as the LF form.:=on a UDT field in a single-line function or method body): codegen: five fixes for 1.8.0 (late restore, statement-order var initialization, request.currency_rate, helper-local var color, one-line field assignment) #261 (the parser change originally proposed as parser: a UDT field assignment as a one-line function or method body (Part of #230) #253).set(State s) => s.value := 1now translates like the same body on its own indented line. A plain-name or subscript target in a one-line body keeps its parser error, as before.Both ship in codegen 1.8.0. Closing this issue as fixed on main; I will confirm here when 1.8.0 is published.
letiep97 commentedon Oct 28, 2026
Verified both parts on main (
11b5ca5, with engine 1.6.1): the:=on a UDT field in a one-line function body now translates and runs, and the CRLF file from this issue now translates. Thank you for the fixes.