# Is this Makie file not parseable by JuliaSyntax.jl?

**URL:** <https://discourse.julialang.org/t/is-this-makie-file-not-parseable-by-juliasyntax-jl/117997>\
**Category:** Performance\
**Created:** [August 9, 2024, 12:27pm UTC](https://discourse.julialang.org/t/is-this-makie-file-not-parseable-by-juliasyntax-jl/117997 "2024-08-09T12:27:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sixzero](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sixzero/32/28737_2.png) [@Sixzero](https://discourse.julialang.org/u/Sixzero)\
**Post date:** [August 9, 2024, 12:27pm UTC](https://discourse.julialang.org/t/is-this-makie-file-not-parseable-by-juliasyntax-jl/117997/1 "2024-08-09T12:27:57Z")

</div>

I just tried to parse the file:

```julia
file_path = ~/.julia/packages/Makie/rEu75/src/Makie.jl

@info "Processing file: $file_path"
s = read(file_path, String)
@time expr2 = parsestmt(JuliaSyntax.SyntaxNode, "begin\n"*s*"\nend", filename=file_path)

```

And I am getting this error:

```julia
[ Info: Processing file: ~/.julia/packages/Makie/rEu75/src/Makie.jl
ERROR: ParseError:
# Warning @ ~/.julia/packages/Makie/rEu75/src/Makie.jl:68:35
using IntervalSets: IntervalSets, (..), OpenInterval, ClosedInterval, AbstractInterval, Interval, endpoints, leftendpoint, rightendpoint
# └──┘ ── parentheses are not required here
# Warning @ /home/six/.julia/packages/Makie/rEu75/src/Makie.jl:303:8
export Vec, Vec2, Vec3, Vec4, Point, Point2, Point3, Point4
export (..)

```

Shouldn’t JuliaSyntax be able to parse all julia files? Or am I missing something?

---

<div class="post-metadata">

**Author:** ![nsajko](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nsajko/32/221187_2.png) [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Post date:** [August 9, 2024, 1:53pm UTC](https://discourse.julialang.org/t/is-this-makie-file-not-parseable-by-juliasyntax-jl/117997/2 "2024-08-09T13:53:52Z")

</div>

Complete example:

```julia-repl
julia> using JuliaSyntax; file_path = "/tmp/Makie.jl/src/Makie.jl"; s = read(file_path, String);
Precompiling JuliaSyntax...
  1 dependency successfully precompiled in 14 seconds

julia> parsestmt(JuliaSyntax.SyntaxNode, s, filename=file_path)
ERROR: ParseError:
# Warning @ /tmp/Makie.jl/src/Makie.jl:67:35

using IntervalSets: IntervalSets, (..), OpenInterval, ClosedInterval, AbstractInterval, Interval, endpoints, leftendpoint, rightendpoint
# └──┘ ── parentheses are not required here
# Warning @ /tmp/Makie.jl/src/Makie.jl:303:8
export Vec, Vec2, Vec3, Vec4, Point, Point2, Point3, Point4
export (..)
# └──┘ ── parentheses are not required here
Stacktrace:
 [1] _parse(rule::Symbol, need_eof::Bool, ::Type{…}, text::String, index::Int64; version::VersionNumber, ignore_trivia::Bool, filename::String, first_line::Int64, ignore_errors::Bool, ignore_warnings::Bool, kws::@Kwargs{})
   @ JuliaSyntax ~/.julia/packages/JuliaSyntax/irSvg/src/parser_api.jl:87
 [2] _parse (repeats 2 times)
   @ ~/.julia/packages/JuliaSyntax/irSvg/src/parser_api.jl:71 [inlined]
 [3] #parsestmt#95
   @ ~/.julia/packages/JuliaSyntax/irSvg/src/parser_api.jl:134 [inlined]
 [4] top-level scope
   @ REPL[2]:1
Some type information was truncated. Use `show(err)` to see complete types.

```

Reproduces with all versions of JuliaSyntax.jl from v0.4.5 to v0.4.9. @c42f is this a bug?

---

<div class="post-metadata">

**Author:** ![savq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/savq/32/22063_2.png) [@savq](https://discourse.julialang.org/u/savq)\
**Post date:** [August 9, 2024, 10:32pm UTC](https://discourse.julialang.org/t/is-this-makie-file-not-parseable-by-juliasyntax-jl/117997/3 "2024-08-09T22:32:27Z")

</div>

This was fixed a couple of weeks ago: JuliaLang/JuliaSyntax.jl#477

TL;DR: Allowing parentheses in imports is bad, but the operator `..` conflicts with import paths like `..SibilingModule`. Ideally, it should be imported as `var".."`, but for now, an exception was made to allow `(..)`.

---

<div class="post-metadata">

**Author:** ![c42f](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/c42f/32/52842_2.png) [@c42f](https://discourse.julialang.org/u/c42f)\
**Post date:** [August 10, 2024, 12:02pm UTC](https://discourse.julialang.org/t/is-this-makie-file-not-parseable-by-juliasyntax-jl/117997/4 "2024-08-10T12:02:34Z")

</div>

Actually this is just a warning, but warnings are set to become errors by default in `parsestmt()`. You can use `parsestmt(..., ignore_warnings=true)` to get the behavior used by `Base` Julia (currently used because there’s no way to emit parser warnings from the Julia runtime).

This particular warning was a bug and has been fixed as pointed out by @savq.
