Skip to content

Commit

Permalink
merge branch 'master'
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebolewski committed Oct 6, 2014
2 parents 09fa3b0 + 1224d7f commit 6c52fb6
Show file tree
Hide file tree
Showing 104 changed files with 3,704 additions and 3,019 deletions.
1 change: 1 addition & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ their own licenses:
- [FFTW](http://fftw.org/doc/License-and-Copyright.html)
- [GMP](http://gmplib.org/manual/Copying.html#Copying)
- [MPFR](http://www.mpfr.org/mpfr-current/mpfr.html#Copying)
- [MUSL](http://git.musl-libc.org/cgit/musl/tree/COPYRIGHT)
- [OPENBLAS](https://raw.github.com/xianyi/OpenBLAS/master/LICENSE)
- [LAPACK](http://netlib.org/lapack/LICENSE.txt)
- [PCRE](http://www.pcre.org/licence.txt)
Expand Down
2 changes: 1 addition & 1 deletion Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ JLDFLAGS += -Wl,--large-address-aware
endif
else
OSLIBS += kernel32.lib ws2_32.lib psapi.lib advapi32.lib iphlpapi.lib shell32.lib winmm.lib
JLDFLAGS =
JLDFLAGS = -stack:8388608
endif
JCPPFLAGS += -D_WIN32_WINNT=0x0600
UNTRUSTED_SYSTEM_LIBM = 1
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,14 @@ $(build_private_libdir)/sys%ji: $(build_private_libdir)/sys%o
.SECONDARY: $(build_private_libdir)/sys0.o

$(build_private_libdir)/sys%$(SHLIB_EXT): $(build_private_libdir)/sys%o
ifneq ($(USEMSVC), 1)
$(CXX) -shared -fPIC -L$(build_private_libdir) -L$(build_libdir) -L$(build_shlibdir) -o $@ $< \
$$([ $(OS) = Darwin ] && echo '' -Wl,-undefined,dynamic_lookup || echo '' -Wl,--unresolved-symbols,ignore-all ) \
$$([ $(OS) = WINNT ] && echo '' -ljulia -lssp)
$(DSYMUTIL) $@
else
@true
endif

$(build_private_libdir)/sys0.o:
@$(QUIET_JULIA) cd base && \
Expand Down
16 changes: 13 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ Language changes

* `Nothing` (the type of `nothing`) is renamed to `Void` ([#8423]).

* `Dict` literal syntax `[a=>b,c=>d]` is replaced with `Dict(a=>b,c=>d)`.
`{a=>b}` is replaced with `Dict{Any,Any}(a=>b)`.
`(K=>V)[...]` is replaced with `Dict{K,V}(...)`.
The new syntax has many advantages: all of its components are first-class,
it generalizes to other types of containers, it is easier to guess how to
specify key and value types, and the syntaxes for empty and pre-populated
dicts are synchronized. As part of this change, `=>` is parsed as a normal
operator, and `Base` defines it to construct `Pair` objects ([#6739]).

Library improvements
--------------------

Expand Down Expand Up @@ -74,7 +83,7 @@ New language features
generated. Constructors that look like `MyType(a, b) = new(a, b)` do not
need to be added manually ([#4026], [#7071]).

* Expanded array type hierarchy to include an abstract ``DenseArray`` for
* Expanded array type hierarchy to include an abstract `DenseArray` for
in-memory arrays with standard strided storage ([#987], [#2345],
[#6212]).

Expand Down Expand Up @@ -199,8 +208,8 @@ Library improvements

* `writedlm` and `writecsv` now accept any iterable collection of
iterable rows, in addition to `AbstractArray` arguments, and the
``writedlm`` delimiter can be any printable object (e.g. a
``String``) instead of just a ``Char``.
`writedlm` delimiter can be any printable object (e.g. a
`String`) instead of just a `Char`.

* `isempty` now works for any iterable collection ([#5827]).

Expand Down Expand Up @@ -991,3 +1000,4 @@ Too numerous to mention.
[#7311]: https://github.com/JuliaLang/julia/issues/7311
[#8423]: https://github.com/JuliaLang/julia/issues/8423
[#8152]: https://github.com/JuliaLang/julia/pull/8152
[#6739]: https://github.com/JuliaLang/julia/issues/6739
65 changes: 32 additions & 33 deletions base/LineEdit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ using ..Terminals
import ..Terminals: raw!, width, height, cmove, getX,
getY, clear_line, beep

import Base: ensureroom, peek, show
import Base: ensureroom, peek, show, AnyDict

abstract TextInterface

Expand Down Expand Up @@ -834,30 +834,29 @@ function keymap{D<:Dict}(keymaps::Array{D})
end

const escape_defaults = merge!(
(Any=>Any)[char(i) => nothing for i=[1:26, 28:31]], # Ignore control characters by default
(Any=>Any)[ # And ignore other escape sequences by default
"\e*" => nothing,
"\e[*" => nothing,
# Also ignore extended escape sequences
# TODO: Support ranges of characters
"\e[1**" => nothing,
"\e[2**" => nothing,
"\e[3**" => nothing,
"\e[4**" => nothing,
"\e[5**" => nothing,
"\e[6**" => nothing,
"\e[1~" => "\e[H",
"\e[4~" => "\e[F",
"\e[7~" => "\e[H",
"\e[8~" => "\e[F",
"\eOA" => "\e[A",
"\eOB" => "\e[B",
"\eOC" => "\e[C",
"\eOD" => "\e[D",
"\eOH" => "\e[H",
"\eOF" => "\e[F",
]
)
AnyDict([char(i) => nothing for i=[1:26, 28:31]]), # Ignore control characters by default
AnyDict( # And ignore other escape sequences by default
"\e*" => nothing,
"\e[*" => nothing,
# Also ignore extended escape sequences
# TODO: Support ranges of characters
"\e[1**" => nothing,
"\e[2**" => nothing,
"\e[3**" => nothing,
"\e[4**" => nothing,
"\e[5**" => nothing,
"\e[6**" => nothing,
"\e[1~" => "\e[H",
"\e[4~" => "\e[F",
"\e[7~" => "\e[H",
"\e[8~" => "\e[F",
"\eOA" => "\e[A",
"\eOB" => "\e[B",
"\eOC" => "\e[C",
"\eOD" => "\e[D",
"\eOH" => "\e[H",
"\eOF" => "\e[F",
))

function write_response_buffer(s::PromptState, data)
offset = s.input_buffer.ptr
Expand Down Expand Up @@ -998,7 +997,7 @@ end

function setup_search_keymap(hp)
p = HistoryPrompt(hp)
pkeymap = (Any=>Any)[
pkeymap = AnyDict(
"^R" => (s,data,c)->(history_set_backward(data, true); history_next_result(s, data)),
"^S" => (s,data,c)->(history_set_backward(data, false); history_next_result(s, data)),
'\r' => (s,o...)->accept_result(s, p),
Expand Down Expand Up @@ -1067,12 +1066,12 @@ function setup_search_keymap(hp)
edit_insert(data.query_buffer, input); update_display_buffer(s, data)
end,
"*" => (s,data,c)->(edit_insert(data.query_buffer, c); update_display_buffer(s, data))
]
)
p.keymap_func = keymap([pkeymap, escape_defaults])
skeymap = (Any=>Any)[
skeymap = AnyDict(
"^R" => (s,o...)->(enter_search(s, p, true)),
"^S" => (s,o...)->(enter_search(s, p, false)),
]
)
(p, skeymap)
end

Expand Down Expand Up @@ -1119,7 +1118,7 @@ function commit_line(s)
end

const default_keymap =
(Any=>Any)[
AnyDict(
# Tab
'\t' => (s,o...)->begin
buf = buffer(s)
Expand Down Expand Up @@ -1227,9 +1226,9 @@ const default_keymap =
edit_insert(s, input)
end,
"^T" => (s,o...)->edit_transpose(s),
]
)

const history_keymap = (Any=>Any)[
const history_keymap = AnyDict(
"^P" => (s,o...)->(history_prev(s, mode(s).hist)),
"^N" => (s,o...)->(history_next(s, mode(s).hist)),
# Up Arrow
Expand All @@ -1240,7 +1239,7 @@ const history_keymap = (Any=>Any)[
"\e[5~" => (s,o...)->(history_prev(s, mode(s).hist)),
# Page Down
"\e[6~" => (s,o...)->(history_next(s, mode(s).hist))
]
)

function deactivate(p::Union(Prompt,HistoryPrompt), s::Union(SearchState,PromptState), termbuf)
clear_input_area(termbuf, s)
Expand Down
17 changes: 9 additions & 8 deletions base/REPL.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import Base:
AsyncStream,
Display,
display,
writemime
writemime,
AnyDict

import ..LineEdit:
CompletionProvider,
Expand Down Expand Up @@ -675,9 +676,9 @@ function setup_interface(repl::LineEditREPL; hascolor = repl.hascolor, extra_rep

# Setup history
# We will have a unified history for all REPL modes
hp = REPLHistoryProvider((Symbol=>Any)[:julia => julia_prompt,
:shell => shell_mode,
:help => help_mode])
hp = REPLHistoryProvider(Dict{Symbol,Any}(:julia => julia_prompt,
:shell => shell_mode,
:help => help_mode))
if !repl.no_history_file
try
f = open(find_hist_file(), true, true, true, false, false)
Expand All @@ -704,7 +705,7 @@ function setup_interface(repl::LineEditREPL; hascolor = repl.hascolor, extra_rep
extra_repl_keymap = [extra_repl_keymap]
end

const repl_keymap = (Any=>Any)[
const repl_keymap = AnyDict(
';' => function (s,o...)
if isempty(s) || position(LineEdit.buffer(s)) == 0
buf = copy(LineEdit.buffer(s))
Expand Down Expand Up @@ -775,14 +776,14 @@ function setup_interface(repl::LineEditREPL; hascolor = repl.hascolor, extra_rep
end
end
end,
]
)

a = Dict{Any,Any}[hkeymap, repl_keymap, LineEdit.history_keymap, LineEdit.default_keymap, LineEdit.escape_defaults]
prepend!(a, extra_repl_keymap)

julia_prompt.keymap_func = LineEdit.keymap(a)

const mode_keymap = (Any=>Any)[
const mode_keymap = AnyDict(
'\b' => function (s,o...)
if isempty(s) || position(LineEdit.buffer(s)) == 0
buf = copy(LineEdit.buffer(s))
Expand All @@ -801,7 +802,7 @@ function setup_interface(repl::LineEditREPL; hascolor = repl.hascolor, extra_rep
transition(s, :reset)
LineEdit.refresh_line(s)
end
]
)

b = Dict{Any,Any}[hkeymap, mode_keymap, LineEdit.history_keymap, LineEdit.default_keymap, LineEdit.escape_defaults]
prepend!(b, extra_repl_keymap)
Expand Down
8 changes: 4 additions & 4 deletions base/cartesian.jl
Original file line number Diff line number Diff line change
Expand Up @@ -451,10 +451,10 @@ end

## Resolve expressions at parsing time ##

const exprresolve_arith_dict = (Symbol=>Function)[:+ => +,
:- => -, :* => *, :/ => /, :^ => ^, :div => div]
const exprresolve_cond_dict = (Symbol=>Function)[:(==) => ==,
:(<) => <, :(>) => >, :(<=) => <=, :(>=) => >=]
const exprresolve_arith_dict = Dict{Symbol,Function}(:+ => +,
:- => -, :* => *, :/ => /, :^ => ^, :div => div)
const exprresolve_cond_dict = Dict{Symbol,Function}(:(==) => ==,
:(<) => <, :(>) => >, :(<=) => <=, :(>=) => >=)

function exprresolve_arith(ex::Expr)
if ex.head == :call && haskey(exprresolve_arith_dict, ex.args[1]) && all([isa(ex.args[i], Number) for i = 2:length(ex.args)])
Expand Down
4 changes: 2 additions & 2 deletions base/client.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

const ARGS = UTF8String[]

const text_colors = (Any=>Any)[
const text_colors = AnyDict(
:black => "\033[1m\033[30m",
:red => "\033[1m\033[31m",
:green => "\033[1m\033[32m",
Expand All @@ -14,7 +14,7 @@ const text_colors = (Any=>Any)[
:white => "\033[1m\033[37m",
:normal => "\033[0m",
:bold => "\033[1m",
]
)

have_color = false
@unix_only default_color_answer = text_colors[:bold]
Expand Down
Loading

0 comments on commit 6c52fb6

Please sign in to comment.