Skip to content

Fix early-abort handling in array_parse#72

Merged
pfitzseb merged 4 commits intomainfrom
sp/array_parse-early-abort
Aug 25, 2022
Merged

Fix early-abort handling in array_parse#72
pfitzseb merged 4 commits intomainfrom
sp/array_parse-early-abort

Conversation

@pfitzseb
Copy link
Copy Markdown
Member

@pfitzseb pfitzseb commented Aug 24, 2022

Fixes #66.

@pfitzseb pfitzseb marked this pull request as ready for review August 25, 2022 06:46
@pfitzseb pfitzseb force-pushed the sp/array_parse-early-abort branch from 915884e to d609aa1 Compare August 25, 2022 06:47
@pfitzseb pfitzseb force-pushed the sp/array_parse-early-abort branch from d609aa1 to 0f5460c Compare August 25, 2022 06:49
@pfitzseb pfitzseb requested a review from c42f August 25, 2022 06:50
Copy link
Copy Markdown
Member

@c42f c42f left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's ensure parse_array looks for the closer for consistency. Still doesn't give the best error, but this does seem like an obscure edge case.

BTW, there's a tool itest_parse for interactive development showing the various trees and the flisp parser output

julia> include("test/test_utils.jl")

julia> itest_parse(JuliaSyntax.parse_expr, "[a@b]")
# Code:
[a@b]

# Green tree:
     1:5      │[hcat]
     1:1      │  [                          "["
     2:2      │  Identifier             ✔   "a"
     3:4      │  [error]                 ✘
     3:3      │    @                    ✔   "@"
     4:4      │    Identifier           ✔   "b"
     5:5      │  ]                          "]"
Error: Expected `]`
@ line 1:3
[a@b]

# SyntaxNode:
(hcat a (error-t ✘ b))

Comment thread test/parser.jl Outdated
Comment thread src/parser.jl
@pfitzseb pfitzseb requested a review from c42f August 25, 2022 08:38
Comment thread src/parser.jl
Co-authored-by: c42f <chris42f@gmail.com>
@pfitzseb pfitzseb merged commit 291da24 into main Aug 25, 2022
@pfitzseb pfitzseb deleted the sp/array_parse-early-abort branch August 25, 2022 10:33
c42f pushed a commit to JuliaLang/julia that referenced this pull request Oct 17, 2025
…y_parse-early-abort

Fix early-abort handling in array_parse
topolarity pushed a commit to JuliaLang/julia that referenced this pull request Nov 14, 2025
…y_parse-early-abort

Fix early-abort handling in array_parse
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.

dim can overflow in parse_array

2 participants