Skip to content

Commit

Permalink
deprecated and replaced linefilter with linefilter!
Browse files Browse the repository at this point in the history
  • Loading branch information
chakravala committed Dec 3, 2018
1 parent 0ba59d3 commit ea9e244
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/src/library.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Reduce.unfoldgen
```

```@docs
Reduce.linefilter
Reduce.linefilter!
```

```@docs
Expand Down
1 change: 1 addition & 0 deletions src/Reduce.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
__precompile__()
module Reduce
using ForceImport, SyntaxTree, LinearAlgebra
!isdefined(Reduce,:linefilter!) && (linefilter! = SyntaxTree.linefilter)

# This file is part of Reduce.jl. It is licensed under the MIT license
# Copyright (C) 2017 Michael Reed
Expand Down
4 changes: 2 additions & 2 deletions src/parser.jl
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ for mode ∈ [:expr,:unary,:switch,:args]
:(print(qr, smp); smp = "")
end))
end
push!(nsr,$((mode == :expr) ? :("("*String(take!(qr))*")" |> Meta.parse |> linefilter) : :qr))
push!(nsr,$((mode == :expr) ? :("("*String(take!(qr))*")" |> Meta.parse |> linefilter!) : :qr))
end; else; :(nothing); end)
elseif occursin("end",sh[en])
nothing
Expand Down Expand Up @@ -600,7 +600,7 @@ end
show_expr(io,expr.args[1])
show_expr(io,expr.args[2])
elseif expr.head == :block
lxpr = linefilter(expr)
lxpr = linefilter!(expr)
if length(lxpr.args) == 1
show_expr(io,lxpr.args[1])
else
Expand Down
20 changes: 12 additions & 8 deletions src/rexpr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,19 @@ Reduce.linelength()::Integer
and sets the output line length to the integer `tput cols`. It returns the output line length (so that it can be stored for later resetting of the output line if needed).
"""
function linelength()
c = read(`tput cols`,String) |> Meta.parse
global cols
if c cols
ws = rcall("ws")
rcall("linelength($c)")
rcall(ws)
cols = c
try
c = read(`tput cols`,String) |> Meta.parse
global cols
if c cols
ws = rcall("ws")
rcall("linelength($c)")
rcall(ws)
cols = c
end
return c
catch
ColCheck(false)
end
return c
end

function show(io::IO, ::MIME"text/plain", r::RExpr)
Expand Down

0 comments on commit ea9e244

Please sign in to comment.