Re: [julia-users] parse() and line numbers

2015-03-18 Thread cormullion
Thanks, Isaiah. I see there's already an issue for this at 
https://github.com/jakebolewski/JuliaParser.jl/issues/4. 

Re: [julia-users] parse() and line numbers

2015-03-17 Thread Isaiah Norton
Skipping line nodes is straightforward (look at the output of
`dump(expr)`). To hard-code it, you could look at modifying JuliaParser.jl.
Likewise with comments, but that will take more work because they are
simply skipped right now (at least in the main scheme parser code; I
haven't checked in JuliaParser.jl)

On Tue, Mar 17, 2015 at 6:56 AM,  wrote:

> Is there a way to prevent the generation of line numbers:
>
> julia> jt = """for i in 1:10
>println(i)
>end
>"""
> "for i in 1:10\nprintln(i)\nend\n"
>
> julia> parse(jt)
> :(for i = 1:10 # line 2:   <
> println(i)
> end)
>
> julia>
>
> or of retaining any comments that were in the string:
>
> julia> jt = """for i in 1:10
>  # printing now   <-—
>  println(i)
>end
>"""
>  julia> parse(jt) ...
>
> cheers
>
>


[julia-users] parse() and line numbers

2015-03-17 Thread cormullion
Is there a way to prevent the generation of line numbers:

julia> jt = """for i in 1:10
   println(i)
   end
   """
"for i in 1:10\nprintln(i)\nend\n"

julia> parse(jt)
:(for i = 1:10 # line 2:   <
println(i)
end)

julia> 

or of retaining any comments that were in the string:

julia> jt = """for i in 1:10
 # printing now   <-—
 println(i)
   end
   """
 julia> parse(jt) ...

cheers