Skip to content

Commit

Permalink
Merge pull request #20395 from tkelman/tk/spellingetc
Browse files Browse the repository at this point in the history
Miscellaneous tidying, again
  • Loading branch information
tkelman authored Feb 3, 2017
2 parents f66c866 + 6cd59c4 commit 3db0193
Show file tree
Hide file tree
Showing 21 changed files with 41 additions and 57 deletions.
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ Breaking changes
This section lists changes that do not have deprecation warnings.

* `readline`, `readlines` and `eachline` return lines without line endings by default.
You *must* use `readline(s, chomp=false)`, etc. to get the old behavior where lines
returned include trailing end-of-line character(s). ([#19944])
You *must* use `readline(s, chomp=false)`, etc. to get the old behavior where
returned lines include trailing end-of-line character(s). ([#19944])

* `String`s no longer have a `.data` field (as part of a significant performance
improvement). Use `Vector{UInt8}(str)` to access a string as a byte array.
Expand Down
4 changes: 0 additions & 4 deletions base/client.jl
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,6 @@ function process_options(opts::JLOptions)
println()
break
end
# eval expression but don't disable interactive mode
if opts.postboot != C_NULL
eval(Main, parse_input_line(unsafe_string(opts.postboot)))
end
# load file
if !isempty(ARGS) && !isempty(ARGS[1])
# program
Expand Down
7 changes: 0 additions & 7 deletions base/datafmt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -363,23 +363,16 @@ end

const valid_opts = [:header, :has_header, :use_mmap, :quotes, :comments, :dims, :comment_char, :skipstart, :skipblanks]
const valid_opt_types = [Bool, Bool, Bool, Bool, Bool, NTuple{2,Integer}, Char, Integer, Bool]
const deprecated_opts = Dict(:has_header => :header)

function val_opts(opts)
d = Dict{Symbol,Union{Bool,NTuple{2,Integer},Char,Integer}}()
for (opt_name, opt_val) in opts
if opt_name == :ignore_invalid_chars
Base.depwarn("the ignore_invalid_chars option is no longer supported and will be ignored", :val_opts)
continue
end
in(opt_name, valid_opts) ||
throw(ArgumentError("unknown option $opt_name"))
opt_typ = valid_opt_types[findfirst(valid_opts, opt_name)]
isa(opt_val, opt_typ) ||
throw(ArgumentError("$opt_name should be of type $opt_typ, got $(typeof(opt_val))"))
d[opt_name] = opt_val
haskey(deprecated_opts, opt_name) &&
Base.depwarn("$opt_name is deprecated, use $(deprecated_opts[opt_name]) instead", :val_opts)
end
return d
end
Expand Down
4 changes: 2 additions & 2 deletions base/dates/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ function tryparsenext end
"""
format(io::IO, tok::AbstractDateToken, dt::TimeType, locale)
format the `tok` token from `dt` and write it to `io`. The formatting can
Format the `tok` token from `dt` and write it to `io`. The formatting can
be based on `locale`.
all subtypes of `AbstractDateToken` must define this method in order
All subtypes of `AbstractDateToken` must define this method in order
to be able to print a Date / DateTime object according to a `DateFormat`
containing that token.
"""
Expand Down
4 changes: 4 additions & 0 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,10 @@ function promote_op(op::Type, Ts::Type...)
return op
end

# NOTE: Deprecation of `isdefined(a::Array, i::Int)` is implemented in src/array.c
# and deprecation of `invoke(f, (types...), ...)` is implemented in src/builtins.c
# To be removed when 0.6 deprecations are removed

# NOTE: Deprecation of Channel{T}() is implemented in channels.jl.
# To be removed from there when 0.6 deprecations are removed.

Expand Down
1 change: 0 additions & 1 deletion base/exports.jl
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,6 @@ export
lqfact,
rank,
scale!,
scale,
schur,
schurfact!,
schurfact,
Expand Down
14 changes: 7 additions & 7 deletions base/inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -707,13 +707,13 @@ const TypeName_module_fieldindex = fieldindex(TypeName, :module)
const TypeName_wrapper_fieldindex = fieldindex(TypeName, :wrapper)

function const_datatype_getfield_tfunc(sv, fld)
if (fld == DataType_name_fieldindex ||
fld == DataType_parameters_fieldindex ||
fld == DataType_types_fieldindex ||
fld == DataType_super_fieldindex)
return abstract_eval_constant(getfield(sv, fld))
end
return nothing
if (fld == DataType_name_fieldindex ||
fld == DataType_parameters_fieldindex ||
fld == DataType_types_fieldindex ||
fld == DataType_super_fieldindex)
return abstract_eval_constant(getfield(sv, fld))
end
return nothing
end

# returns (type, isexact)
Expand Down
6 changes: 3 additions & 3 deletions base/libgit2/blob.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ function Base.show(io::IO, blob::GitBlob)
if !isbinary(blob)
conts = split(content(blob), "\n")
showlen = max(length(conts), 3)
print(io, "GitBlob:\nBlob id: ", GitHash(blob), "\nContents:\n")
println(io, "GitBlob:\nBlob id: ", GitHash(blob), "\nContents:")
for i in 1:showlen
print(io, conts[i],"\n")
println(io, conts[i])
end
else
print(io, "GitBlob:\nBlob id: ", GitHash(blob), "\nContents are binary.\n")
println(io, "GitBlob:\nBlob id: ", GitHash(blob), "\nContents are binary.")
end
end
2 changes: 1 addition & 1 deletion base/libgit2/reference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ end
"""
upstream(ref::GitReference) -> Nullable{GitReference}
Determine if the branch specified by `ref` has a specified upstream branch.
Determine if the branch containing `ref` has a specified upstream branch.
`upstream` returns a `Nullable`, which will be null if the requested branch does
not have an upstream counterpart. If the upstream branch does exist, the `Nullable`
Expand Down
1 change: 0 additions & 1 deletion base/libgit2/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ buf_ref = Ref(Buffer())
free(buf_ref)
```
In particular, note that `LibGit2.free` should be called afterward on the `Ref` object.
"""
immutable Buffer
ptr::Ptr{Cchar}
Expand Down
12 changes: 6 additions & 6 deletions base/multimedia.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
module Multimedia

export Display, display, pushdisplay, popdisplay, displayable, redisplay,
MIME, @MIME_str, reprmime, stringmime, istextmime,
mimewritable, TextDisplay
MIME, @MIME_str, reprmime, stringmime, istextmime,
mimewritable, TextDisplay

###########################################################################
# We define a singleton type MIME{mime symbol} for each MIME type, so
Expand Down Expand Up @@ -194,7 +194,7 @@ function display(x)
return display(displays[i], x)
catch e
isa(e, MethodError) && e.f in (display, show) ||
rethrow()
rethrow()
end
end
end
Expand All @@ -208,7 +208,7 @@ function display(m::MIME, x)
return display(displays[i], m, x)
catch e
isa(e, MethodError) && e.f == display ||
rethrow()
rethrow()
end
end
end
Expand Down Expand Up @@ -240,7 +240,7 @@ function redisplay(x)
return redisplay(displays[i], x)
catch e
isa(e, MethodError) && e.f in (redisplay, display, show) ||
rethrow()
rethrow()
end
end
end
Expand All @@ -254,7 +254,7 @@ function redisplay(m::Union{MIME,AbstractString}, x)
return redisplay(displays[i], m, x)
catch e
isa(e, MethodError) && e.f in (redisplay, display) ||
rethrow()
rethrow()
end
end
end
Expand Down
1 change: 0 additions & 1 deletion base/options.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ immutable JLOptions
julia_bin::Ptr{UInt8}
eval::Ptr{UInt8}
print::Ptr{UInt8}
postboot::Ptr{UInt8}
load::Ptr{UInt8}
image_file::Ptr{UInt8}
cpu_target::Ptr{UInt8}
Expand Down
8 changes: 2 additions & 6 deletions base/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,8 @@ haskey(io::IOContext, key) = haskey(io.dict, key)
haskey(io::IO, key) = false
getindex(io::IOContext, key) = getindex(io.dict, key)
getindex(io::IO, key) = throw(KeyError(key))
function get(io::IOContext, key, default)
get(io.dict, key, default)
end
function get(io::IO, key, default)
default
end
get(io::IOContext, key, default) = get(io.dict, key, default)
get(io::IO, key, default) = default

displaysize(io::IOContext) = haskey(io, :displaysize) ? io[:displaysize] : displaysize(io.io)

Expand Down
2 changes: 1 addition & 1 deletion doc/src/manual/arrays.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ behavior, should take care to create a copy of inputs that it may modify.

Many functions for constructing and initializing arrays are provided. In the following list of
such functions, calls with a `dims...` argument can either take a single tuple of dimension sizes
or a series of dimension sizes passed as a variable number of arguments. Most of the functions
or a series of dimension sizes passed as a variable number of arguments. Most of these functions
also accept a first input `T`, which is the element type of the array. If the type `T` is
omitted it will default to `Float64`.

Expand Down
2 changes: 1 addition & 1 deletion src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1264,7 +1264,7 @@ void jl_extern_c(jl_function_t *f, jl_value_t *rt, jl_value_t *argt, char *name)
#endif

#if defined(USE_ORCJIT) || defined(USE_MCJIT)
// make the alias name is valid for the current session
// make sure the alias name is valid for the current session
jl_ExecutionEngine->addGlobalMapping(GA, (void*)(uintptr_t)Addr);
#else
(void)GA; (void)Addr;
Expand Down
2 changes: 1 addition & 1 deletion src/gc.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ typedef struct {
// index of pool that owns this page
uint8_t pool_n;
// Whether any cell in the page is marked
// This bit is set before sweeping iff there's live cells in the page.
// This bit is set before sweeping iff there are live cells in the page.
// Note that before marking or after sweeping there can be live
// (and young) cells in the page for `!has_marked`.
uint8_t has_marked;
Expand Down
1 change: 0 additions & 1 deletion src/jloptions.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ jl_options_t jl_options = { 0, // quiet
NULL, // julia_bin
NULL, // eval
NULL, // print
NULL, // post-boot
NULL, // load
NULL, // image_file (will be filled in below)
NULL, // cpu_target ("native", "core2", etc...)
Expand Down
1 change: 0 additions & 1 deletion src/julia.h
Original file line number Diff line number Diff line change
Expand Up @@ -1673,7 +1673,6 @@ typedef struct {
const char *julia_bin;
const char *eval;
const char *print;
const char *postboot;
const char *load;
const char *image_file;
const char *cpu_target;
Expand Down
6 changes: 3 additions & 3 deletions test/dates/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,9 @@ f = "ymd"
@test Dates.DateTime(string(dt)) == dt

# Vectorized
dr = ["2000-01-01", "2000-01-02", "2000-01-03", "2000-01-04", "2000-01-05"
, "2000-01-06", "2000-01-07", "2000-01-08", "2000-01-09", "2000-01-10"]
dr2 = [Dates.Date(2000):Dates.Date(2000, 1, 10);]
dr = ["2000-01-01", "2000-01-02", "2000-01-03", "2000-01-04", "2000-01-05",
"2000-01-06", "2000-01-07", "2000-01-08", "2000-01-09", "2000-01-10"]
dr2 = [Dates.Date(2000) : Dates.Date(2000, 1, 10);]
@test Dates.Date(dr) == dr2
@test Dates.Date(dr, "yyyy-mm-dd") == dr2
@test Dates.DateTime.(dr) == Dates.DateTime.(dr2)
Expand Down
10 changes: 5 additions & 5 deletions test/parse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -326,10 +326,10 @@ parse("""

# issue #13302
let p = parse("try
a
catch
b, c = t
end")
a
catch
b, c = t
end")
@test isa(p,Expr) && p.head === :try
@test p.args[2] === false
@test p.args[3].args[end] == parse("b,c = t")
Expand Down Expand Up @@ -420,7 +420,7 @@ test_parseerror("0x1.0p", "invalid numeric constant \"0x1.0\"")
# issue #19861 make sure macro-expansion happens in the newest world for top-level expression
@test eval(Base.parse_input_line("""
macro X19861()
return 23341
return 23341
end
@X19861
""")::Expr) == 23341
Expand Down
6 changes: 3 additions & 3 deletions test/spawn.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# This file is a part of Julia. License is MIT: http://julialang.org/license

##################################
# Cross Plaform tests for spawn. #
##################################
###################################
# Cross Platform tests for spawn. #
###################################

valgrind_off = ccall(:jl_running_on_valgrind, Cint, ()) == 0

Expand Down

0 comments on commit 3db0193

Please sign in to comment.