Skip to content

Commit

Permalink
resolved build script issue and REPL prompt problem
Browse files Browse the repository at this point in the history
  • Loading branch information
chakravala committed Aug 25, 2018
1 parent 382b5ff commit c204fab
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 54 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ os:
- osx
julia:
- 0.7
- 1.0

This comment has been minimized.

Copy link
@quinnj

quinnj Aug 26, 2018

Note that once tests pass on 1.0 w/o warnings, you don't really need to test on 0.7 anymore

- nightly
matrix:
allow_failures:
Expand Down
42 changes: 19 additions & 23 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
environment:
matrix:
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.7/julia-0.7-latest-win32.exe"
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.7/julia-0.7-latest-win64.exe"
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe"
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"
- julia_version: 0.7
- julia_version: 1
- julia_version: nightly

platform:
- x86 # 32-bit
- x64 # 64-bit

## uncomment the following lines to allow failures on nightly julia
## (tests will run but not make your overall status red)
matrix:
allow_failures:
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe"
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"
- julia_version: nightly

branches:
only:
Expand All @@ -24,24 +26,18 @@ notifications:
on_build_status_changed: false

install:
- ps: "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12"
# If there's a newer build queued for the same PR, cancel this one
- ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | `
Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
throw "There are newer queued builds for this pull request, failing early." }
# Download most recent Julia Windows binary
- ps: (new-object net.webclient).DownloadFile(
$env:JULIA_URL,
"C:\projects\julia-binary.exe")
# Run installer silently, output to C:\projects\julia
- C:\projects\julia-binary.exe /S /D=C:\projects\julia
- ps: iex ((new-object net.webclient).DownloadString("https://raw.githubusercontent.com/JuliaCI/Appveyor.jl/version-1/bin/install.ps1"))

build_script:
# Need to convert from shallow to complete for Pkg.clone to work
- IF EXIST .git\shallow (git fetch --unshallow)
- C:\projects\julia\bin\julia -e "versioninfo();
Pkg.clone(pwd(), \"Reduce\"); Pkg.build(\"Reduce\")"
- echo "%JL_BUILD_SCRIPT%"
- C:\julia\bin\julia -e "%JL_BUILD_SCRIPT%"

test_script:
- C:\projects\julia\bin\julia -e "Pkg.test(\"Reduce\")"
- echo "%JL_TEST_SCRIPT%"
- C:\julia\bin\julia -e "%JL_TEST_SCRIPT%"

# # Uncomment to support code coverage upload. Should only be enabled for packages
# # which would have coverage gaps without running on Windows
# on_success:
# - echo "%JL_CODECOV_SCRIPT%"
# - C:\julia\bin\julia -e "%JL_CODECOV_SCRIPT%"
2 changes: 1 addition & 1 deletion deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ include("svn.jl")
if isfile("ver")
global ver = NaN
open("ver","r") do f
global ver = read(f,String) |> parse
global ver = parse(Int,read(f,String))
end
if ver ρ
if Sys.islinux()
Expand Down
6 changes: 4 additions & 2 deletions deps/svn.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ rpsl = "redcsl"
date = Dict(
0 => "2017-05-16",
1 => "2018-01-17",
2 => "2018-04-06")
2 => "2018-04-06",
3 => "2018-08-08")

rsvn = Dict(
0 => "4052",
1 => "4372",
2 => "4567")
2 => "4567",
3 => "4717")

function _spawn(cmd, input=devnull, output=devnull)
run(pipeline(cmd, stdin=input, stdout=output, stderr=stderr), wait=false)
Expand Down
52 changes: 24 additions & 28 deletions src/repl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ans = nothing
Examine the buffer in the repl to see if the input is complete
"""
function finished(s)
str = String(LineEdit.buffer(s))
str = String(take!(copy(LineEdit.buffer(s))))
if length(str) == 0
return false
elseif occursin(r"(^|\n)[^%\n]*(;|\$)[ ]*(%[^\n]*)?$",str)
Expand Down Expand Up @@ -95,37 +95,33 @@ function create_reduce_repl(repl, main)
end

function repl_init(repl)
try
rirepl = isdefined(repl, :ri) ? repl.ri : repl
main_mode = rirepl.interface.modes[1]
reduce_mode = create_reduce_repl(rirepl, main_mode)
push!(rirepl.interface.modes, reduce_mode)
#const reduce_prompt_keymap = dict{any,any}(
reduce_prompt_keymap = dict{any,any}(
'}' => function (s,args...)
if isempty(s) || position(LineEdit.buffer(s)) == 0
buf = copy(LineEdit.buffer(s))
LineEdit.transition(s, reduce_mode) do
LineEdit.state(s, reduce_mode).input_buffer = buf
end
rirepl = isdefined(repl, :ri) ? repl.ri : repl
main_mode = rirepl.interface.modes[1]
reduce_mode = create_reduce_repl(rirepl, main_mode)
push!(rirepl.interface.modes, reduce_mode)
reduce_prompt_keymap = Dict{Any,Any}(
'}' => function (s,args...)
if isempty(s) || position(LineEdit.buffer(s)) == 0
buf = copy(LineEdit.buffer(s))
LineEdit.transition(s, reduce_mode) do
LineEdit.state(s, reduce_mode).input_buffer = buf
end
else
if !isdefined(Main,:OhMyREPL)
LineEdit.edit_insert(s, '}')
else
if !isdefined(Main,:OhMyREPL)
LineEdit.edit_insert(s, '}')
if Main.OhMyREPL.BracketInserter.AUTOMATIC_BRACKET_MATCH[] &&
!eof(LineEdit.buffer(s)) &&
Main.OhMyREPL.BracketInserter.peek(LineEdit.buffer(s)) == '}'
LineEdit.edit_move_right(LineEdit.buffer(s))
else
if Main.OhMyREPL.BracketInserter.AUTOMATIC_BRACKET_MATCH[] &&
!eof(LineEdit.buffer(s)) &&
Main.OhMyREPL.BracketInserter.peek(LineEdit.buffer(s)) == '}'
LineEdit.edit_move_right(LineEdit.buffer(s))
else
LineEdit.edit_insert(LineEdit.buffer(s), '}')
end
Main.OhMyREPL.Prompt.rewrite_with_ANSI(s)
LineEdit.edit_insert(LineEdit.buffer(s), '}')
end
Main.OhMyREPL.Prompt.rewrite_with_ANSI(s)
end
end)
main_mode.keymap_dict = LineEdit.keymap_merge(
end
end)
main_mode.keymap_dict = LineEdit.keymap_merge(
main_mode.keymap_dict, reduce_prompt_keymap)
catch
end
nothing
end

0 comments on commit c204fab

Please sign in to comment.