Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parsing of REDUCE for expression broken in Julia 1.10 #59

Open
chakravala opened this issue Feb 16, 2024 · 0 comments
Open

parsing of REDUCE for expression broken in Julia 1.10 #59

chakravala opened this issue Feb 16, 2024 · 0 comments

Comments

@chakravala
Copy link
Owner

The parsing of REDUCE for statements is broken with Julia 1.10 and I am not currently planning on figuring out how to fix it:

julia> Expr(:for, :(i = 2:34), :(product(i))) |> RExpr |> Reduce.parse
:($(Expr(:incomplete, Base.Meta.ParseError("ParseError:\n# Error @ none:1:6\nfor i\n#    └ ── premature end of input", Base.JuliaSyntax.ParseError(Base.JuliaSyntax.SourceFile("for i", 0, "none", 1, [1, 6]), Base.JuliaSyntax.Diagnostic[Base.JuliaSyntax.Diagnostic(6, 5, :error, "premature end of input"), Base.JuliaSyntax.Diagnostic(6, 5, :error, "invalid iteration spec: expected one of `=` `in` or `∈`"), Base.JuliaSyntax.Diagnostic(6, 5, :error, "premature end of input"), Base.JuliaSyntax.Diagnostic(6, 5, :error, "Expected `end`")], :other)))) = 2:34 * product(im))

julia> ans |> dump
Expr
  head: Symbol =
  args: Array{Any}((2,))
    1: Expr
      head: Symbol incomplete
      args: Array{Any}((1,))
        1: Base.Meta.ParseError
          msg: String "ParseError:\n# Error @ none:1:6\nfor i\n#    └ ── premature end of input"
          detail: Base.JuliaSyntax.ParseError
            source: Base.JuliaSyntax.SourceFile
              code: SubString{String}
                string: String "for i:=2:34 product(i)"
                offset: Int64 0
                ncodeunits: Int64 5
              byte_offset: Int64 0
              filename: String "none"
              first_line: Int64 1
              line_starts: Array{Int64}((2,)) [1, 6]
            diagnostics: Array{Base.JuliaSyntax.Diagnostic}((4,))
              1: Base.JuliaSyntax.Diagnostic
                first_byte: Int64 6
                last_byte: Int64 5
                level: Symbol error
                message: String "premature end of input"
              2: Base.JuliaSyntax.Diagnostic
                first_byte: Int64 6
                last_byte: Int64 5
                level: Symbol error
                message: String "invalid iteration spec: expected one of `=` `in` or `∈`"
              3: Base.JuliaSyntax.Diagnostic
                first_byte: Int64 6
                last_byte: Int64 5
                level: Symbol error
                message: String "premature end of input"
              4: Base.JuliaSyntax.Diagnostic
                first_byte: Int64 6
                last_byte: Int64 5
                level: Symbol error
                message: String "Expected `end`"
            incomplete_tag: Symbol other
    2: Expr
      head: Symbol call
      args: Array{Any}((3,))
        1: Symbol :
        2: Int64 2
        3: Expr
          head: Symbol call
          args: Array{Any}((3,))
            1: Symbol *
            2: Int64 34
            3: Expr
              head: Symbol call
              args: Array{Any}((2,))
                1: Symbol product
                2: Symbol im
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant