Skip to content

Commit

Permalink
Fix typos (#9638)
Browse files Browse the repository at this point in the history
  • Loading branch information
m-o-e committed Jul 28, 2020
1 parent 72b50e8 commit fd5e53f
Show file tree
Hide file tree
Showing 35 changed files with 48 additions and 48 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Expand Up @@ -520,8 +520,8 @@

- Fixed indent after comment inside indexer. ([#8627](https://github.com/crystal-lang/crystal/pull/8627), thanks @asterite)
- Fixed indent of comments at the end of a proc literal. ([#8778](https://github.com/crystal-lang/crystal/pull/8778), thanks @asterite)
- Fixed crash when formating comment after macro. ([#8697](https://github.com/crystal-lang/crystal/pull/8697), thanks @asterite)
- Fixed crash when formating `exp.!`. ([#8768](https://github.com/crystal-lang/crystal/pull/8768), thanks @asterite)
- Fixed crash when formatting comment after macro. ([#8697](https://github.com/crystal-lang/crystal/pull/8697), thanks @asterite)
- Fixed crash when formatting `exp.!`. ([#8768](https://github.com/crystal-lang/crystal/pull/8768), thanks @asterite)
- Removes unnecessary escape sequences. ([#8619](https://github.com/crystal-lang/crystal/pull/8619), thanks @RX14)

### Doc generator
Expand Down Expand Up @@ -3493,7 +3493,7 @@
* Added `IO#gets_to_end`.
* Added backticks (`...`) and `%x(...)` for command execution.
* Added `%r(...)` for regular expression literals.
* Allow interpolations in regular expresion literals.
* Allow interpolations in regular expression literals.
* Compiling with `--release` sets a `release` flag that you can test with `ifdef`.
* Allow passing splats to C functions
* A C type can now be declared like `type Name = Type` (`type Name : Type` will be deprecated).
Expand Down
2 changes: 1 addition & 1 deletion spec/compiler/semantic/class_var_spec.cr
Expand Up @@ -437,7 +437,7 @@ describe "Semantic: class var" do
)) { int32 }
end

it "doesn't error on recursive depdendency if var is nilable (#2943)" do
it "doesn't error on recursive dependency if var is nilable (#2943)" do
assert_type(%(
class Foo
@@foo : Int32?
Expand Down
2 changes: 1 addition & 1 deletion spec/compiler/semantic/reflection_spec.cr
Expand Up @@ -9,7 +9,7 @@ describe "Semantic: reflection" do
assert_type("Class") { types["Class"] }
end

it "types Object and Class metaclases" do
it "types Object and Class metaclasses" do
assert_type("Object.class") { types["Class"] }
assert_type("Class.class") { types["Class"] }
end
Expand Down
2 changes: 1 addition & 1 deletion spec/generate_windows_spec.sh
Expand Up @@ -6,7 +6,7 @@ set +x
# * `failed codegen` annotates specs that error in the compiler.
# This is mostly caused by some API not being ported to win32 (either the spec
# target itself or some tools used by the spec).
# * `failed linking` annotats specs that compile but don't link (at least not on
# * `failed linking` annotates specs that compile but don't link (at least not on
# basis of the libraries from *Porting to Windows* guide).
# Most failers are caused by missing libraries (libxml2, libyaml, libgmp,
# libllvm, libz, libssl), but there also seem to be some incompatibilities
Expand Down
2 changes: 1 addition & 1 deletion src/channel.cr
Expand Up @@ -187,7 +187,7 @@ class Channel(T)
# All items successfully sent to the channel can be received, before `#receive` considers the channel closed.
# Calling `#close` on a closed channel does not have any effect.
#
# It returns `true` when the channel was successfuly closed, or `false` if it was already closed.
# It returns `true` when the channel was successfully closed, or `false` if it was already closed.
def close : Bool
sender_list = Crystal::PointerLinkedList(Sender(T)).new
receiver_list = Crystal::PointerLinkedList(Receiver(T)).new
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/crystal/codegen/call.cr
Expand Up @@ -25,7 +25,7 @@ class Crystal::CodeGenVisitor
return false if @builder.end

if block = node.block
# A block might turn into a proc literal but not be used if it particpates in a dispatch
# A block might turn into a proc literal but not be used if it participates in a dispatch
if (fun_literal = block.fun_literal) && node.target_def.uses_block_arg?
codegen_call_with_block_as_fun_literal(node, fun_literal, owner, call_args)
else
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/crystal/codegen/primitives.cr
Expand Up @@ -736,7 +736,7 @@ class Crystal::CodeGenVisitor
def codegen_primitive_pointer_set(node, target_def, call_args)
type = context.type.remove_typedef.as(PointerInstanceType)

# Assinging to a Pointer(Void) has no effect
# Assigning to a Pointer(Void) has no effect
return llvm_nil if type.element_type.void?

value = call_args[1]
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/crystal/macros.cr
Expand Up @@ -1615,7 +1615,7 @@ module Crystal::Macros
# class MagicConstant < ASTNode
# end

# A fictitious node representing an idenfitifer like, `foo`, `Bar` or `something_else`.
# A fictitious node representing an identifier like, `foo`, `Bar` or `something_else`.
#
# The parser doesn't create this nodes. Instead, you create them by invoking `id`
# on some nodes. For example, invoking `id` on a `StringLiteral` returns a `MacroId`
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/crystal/semantic.cr
Expand Up @@ -4,7 +4,7 @@ require "./syntax/visitor"
require "./semantic/*"

# The overall algorithm for semantic analysis of a program is:
# - top level: declare clases, modules, macros, defs and other top-level stuff
# - top level: declare classes, modules, macros, defs and other top-level stuff
# - new methods: create `new` methods for every `initialize` method
# - type declarations: process type declarations like `@x : Int32`
# - check abstract defs: check that abstract defs are implemented
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/crystal/semantic/call.cr
Expand Up @@ -131,7 +131,7 @@ class Crystal::Call
named_args_types = NamedArgumentType.from_args(named_args, with_literals)
matches = lookup_matches_without_splat arg_types, named_args_types, with_literals

# If we checked for automatic casts, see if an ambigous call was produced
# If we checked for automatic casts, see if an ambiguous call was produced
if with_literals
arg_types.each &.check_restriction_exception
named_args_types.try &.each &.type.check_restriction_exception
Expand Down
6 changes: 3 additions & 3 deletions src/compiler/crystal/semantic/exhaustiveness_checker.cr
Expand Up @@ -16,7 +16,7 @@ struct Crystal::ExhaustivenessChecker
cond_type = cond.type?

# No type on condition means we couldn't type it so we can't
# check exhasutiveness.
# check exhaustiveness.
return unless cond_type

# Compute all types that we must cover.
Expand Down Expand Up @@ -99,7 +99,7 @@ struct Crystal::ExhaustivenessChecker
elements = cond.elements

# No type on condition means we couldn't type it so we can't
# check exhasutiveness.
# check exhaustiveness.
return unless elements.all? &.type?

element_types = elements.map &.type
Expand Down Expand Up @@ -179,7 +179,7 @@ struct Crystal::ExhaustivenessChecker
end
end

# Retuens an array of all the types inside `type`:
# Returns an array of all the types inside `type`:
# for unions it's all the union types, otherwise it's just that type.
private def expand_types(type)
if type.is_a?(UnionType)
Expand Down
10 changes: 5 additions & 5 deletions src/compiler/crystal/semantic/main_visitor.cr
Expand Up @@ -58,11 +58,11 @@ module Crystal
property yield_vars : Array(Var)?

# In vars we store the types of variables as we traverse the nodes.
# These type are not cummulative: if you do `x = 1`, 'x' will have
# These type are not cumulative: if you do `x = 1`, 'x' will have
# type Int32. Then if you do `x = false`, 'x' will have type Bool.
getter vars

# Here we store the cummulative types of variables as we traverse the nodes.
# Here we store the cumulative types of variables as we traverse the nodes.
getter meta_vars : MetaVars
property is_initialize : Bool
property exception_handler_vars : MetaVars? = nil
Expand Down Expand Up @@ -127,7 +127,7 @@ module Crystal

# We initialize meta_vars from vars given in the constructor.
# We store those meta vars either in the typed def or in the program
# so the codegen phase knows the cummulative types to do allocas.
# so the codegen phase knows the cumulative types to do allocas.
unless meta_vars
if typed_def = @typed_def
meta_vars = typed_def.vars = MetaVars.new
Expand Down Expand Up @@ -843,7 +843,7 @@ module Crystal
def type_assign(target : InstanceVar, value, node)
# Check if this is an instance variable initializer
unless @scope
# `InstanceVar` assignment appered in block is not checked
# `InstanceVar` assignment appeared in block is not checked
# by `Crystal::InstanceVarsInitializerVisitor` because this block
# may be passed to a macro. So, it checks here.
if current_type.is_a?(Program) || current_type.is_a?(FileModule)
Expand Down Expand Up @@ -1288,7 +1288,7 @@ module Crystal
if expand_macro(node)
# It can happen that this call is inside an ArrayLiteral or HashLiteral,
# was expanded but isn't bound to the expansion because the call (together
# with its expantion) was cloned.
# with its expansion) was cloned.
if (expanded = node.expanded) && (!node.dependencies? || !node.type?)
node.bind_to(expanded)
end
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/crystal/semantic/method_lookup.cr
Expand Up @@ -305,7 +305,7 @@ module Crystal
if a_def.double_splat
match_arg_type = named_arg.type

# If there's a restrction on the double splat, check that it matches
# If there's a restriction on the double splat, check that it matches
if double_splat_restriction
if double_splat_entries
double_splat_entries << named_arg
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/crystal/semantic/top_level_visitor.cr
Expand Up @@ -1147,7 +1147,7 @@ class Crystal::TopLevelVisitor < Crystal::SemanticVisitor
next_type = base_type.lookup_path_item(name, lookup_in_namespace: false, include_private: true, location: path.location)
if next_type
if next_type.is_a?(ASTNode)
path.raise "execpted #{name} to be a type"
path.raise "expected #{name} to be a type"
end
else
base_type = check_type_is_type_container(base_type, path)
Expand Down
Expand Up @@ -105,7 +105,7 @@ struct Crystal::TypeDeclarationProcessor
# they are initialized in at least one of the initialize methods.
@non_nilable_instance_vars = {} of Type => Array(String)

# Nilable variables there were detected to not be initilized in an initialize,
# Nilable variables there were detected to not be initialized in an initialize,
# but a superclass does initialize it. It's only an error if the explicit/guessed
# type is not nilable itself.
@nilable_instance_vars = {} of Type => Hash(String, InitializeInfo)
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/crystal/tools/doc/method.cr
Expand Up @@ -38,7 +38,7 @@ class Crystal::Doc::Method
end

# Returns this method's docs ready to be shown (before formatting)
# in the UI. This includes copiying docs from previous def or
# in the UI. This includes copying docs from previous def or
# ancestors and replacing `:inherit:` with the ancestor docs.
# This docs not include the "Description copied from ..." banner
# in case it's needed.
Expand Down
Expand Up @@ -61,7 +61,7 @@ module Crystal
# so the instrumentor can ignore call's of methods with this name
# this will avoid instrumenting calls to methods with the same name than
# declared macros in the playground source. For a more accurate solution
# a compilation should be done to distigush whether each call refers to a macro or
# a compilation should be done to distinguish whether each call refers to a macro or
# a method. Between the macro names collection and only instrumenting def's inside
# modules/classes the generated instrumentation is pretty good enough. See #2355
collector = MacroDefNameCollector.new
Expand Down
2 changes: 1 addition & 1 deletion src/crystal/dwarf/line_numbers.cr
Expand Up @@ -159,7 +159,7 @@ module Crystal
end
end

# Matrix of decompressed `Row` to search line number informations from the
# Matrix of decompressed `Row` to search line number information from the
# address of an instruction.
#
# The matrix contains indexed references to `directories` and `files` to
Expand Down
2 changes: 1 addition & 1 deletion src/docs_pseudo_methods.cr
Expand Up @@ -50,7 +50,7 @@ end

# Returns the instance size of the given class as number of bytes.
#
# *type* must be a constant or `typeof()` expresion. It cannot be evaluated at runtime.
# *type* must be a constant or `typeof()` expression. It cannot be evaluated at runtime.
#
# ```
# instance_sizeof(String) # => 16
Expand Down
2 changes: 1 addition & 1 deletion src/exception/call_stack/mach_o.cr
Expand Up @@ -44,7 +44,7 @@ struct Exception::CallStack
end
end

# DWARF uses fixed addresses but Darwin loads exectutables at a random
# DWARF uses fixed addresses but Darwin loads executables at a random
# address, so we must remove the load offset from the IP to match the
# addresses in DWARF sections.
#
Expand Down
2 changes: 1 addition & 1 deletion src/float/printer/grisu3.cr
Expand Up @@ -341,7 +341,7 @@ module Float::Printer::Grisu3
# the difference between w and boundary_minus/plus (a power of 2) and to
# compute scaled_boundary_minus/plus by subtracting/adding from
# scaled_w. However the code becomes much less readable and the speed
# enhancements are not terriffic.
# enhancements are not terrific.
scaled_boundary_minus = boundaries[:minus] * ten_mk
scaled_boundary_plus = boundaries[:plus] * ten_mk

Expand Down
2 changes: 1 addition & 1 deletion src/hash.cr
Expand Up @@ -140,7 +140,7 @@ class Hash(K, V)
# shift of the buffer (expensive).
#
# There might be other optimizations to try out, like not using Linear Probing,
# but for now this implementaton is much faster than the old one which used
# but for now this implementation is much faster than the old one which used
# linked lists (closed addressing).
#
# All methods that deal with this implementation come after the constructors.
Expand Down
2 changes: 1 addition & 1 deletion src/http/server/response.cr
Expand Up @@ -96,7 +96,7 @@ class HTTP::Server
raise "Can't read from HTTP::Server::Response"
end

# Upgrades this response, writing headers and yieling the connection `IO` (a socket) to the given block.
# Upgrades this response, writing headers and yielding the connection `IO` (a socket) to the given block.
# This is useful to implement protocol upgrades, such as websockets.
def upgrade(&block : IO ->)
write_headers
Expand Down
2 changes: 1 addition & 1 deletion src/humanize.cr
Expand Up @@ -64,7 +64,7 @@ struct Number
SI_PREFIXES = { {'y', 'z', 'a', 'f', 'p', 'n', 'µ', 'm'}, {nil, 'k', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'} }

# SI prefixes used by `#humanize`. Equal to `SI_PREFIXES` but prepends the
# prefix with a space charater.
# prefix with a space character.
SI_PREFIXES_PADDED = ->(magnitude : Int32, _number : Float64) do
magnitude = Number.prefix_index(magnitude)
{magnitude, (magnitude == 0 ? " " : si_prefix(magnitude))}
Expand Down
2 changes: 1 addition & 1 deletion src/json/from_json.cr
Expand Up @@ -310,7 +310,7 @@ def Union.new(pull : JSON::PullParser)
{% end %}
end

# Reads a string from JSON parser as a time formated according to [RFC 3339](https://tools.ietf.org/html/rfc3339)
# Reads a string from JSON parser as a time formatted according to [RFC 3339](https://tools.ietf.org/html/rfc3339)
# or other variations of [ISO 8601](http://xml.coverpages.org/ISO-FDIS-8601.pdf).
#
# The JSON format itself does not specify a time data type, this method just
Expand Down
2 changes: 1 addition & 1 deletion src/json/to_json.cr
Expand Up @@ -166,7 +166,7 @@ struct Enum
end

struct Time
# Emits a string formated according to [RFC 3339](https://tools.ietf.org/html/rfc3339)
# Emits a string formatted according to [RFC 3339](https://tools.ietf.org/html/rfc3339)
# ([ISO 8601](http://xml.coverpages.org/ISO-FDIS-8601.pdf) profile).
#
# The JSON format itself does not specify a time data type, this method just
Expand Down
2 changes: 1 addition & 1 deletion src/log/main.cr
Expand Up @@ -66,7 +66,7 @@ class Log
# :ditto:
def self.context=(value : Log::Context)
# NOTE: There is a need for `Metadata` and `Context` setters in
# becuase `Log.context` returns a `Log::Context` for allowing DSL like `Log.context.set(a: 1)`
# because `Log.context` returns a `Log::Context` for allowing DSL like `Log.context.set(a: 1)`
# but if the metadata is built manually the construct `Log.context = metadata` will be used.
Log.context = value.metadata
end
Expand Down
2 changes: 1 addition & 1 deletion src/openssl/ssl/context.cr
Expand Up @@ -215,7 +215,7 @@ abstract class OpenSSL::SSL::Context
LibSSL.ssl_ctx_free(@handle)
end

# Sets the default paths for `ca_certiifcates=` and `ca_certificates_path=`.
# Sets the default paths for `ca_certificates=` and `ca_certificates_path=`.
def set_default_verify_paths
LibSSL.ssl_ctx_set_default_verify_paths(@handle)
end
Expand Down
2 changes: 1 addition & 1 deletion src/option_parser.cr
Expand Up @@ -221,7 +221,7 @@ class OptionParser
end

# Adds a separator, with an optional header message, that will be used to
# print the help. The seperator is placed between the flags registered (`#on`)
# print the help. The separator is placed between the flags registered (`#on`)
# before, and the flags registered after the call.
#
# This way, you can group the different options in an easier to read way.
Expand Down
8 changes: 4 additions & 4 deletions src/slice.cr
Expand Up @@ -357,7 +357,7 @@ struct Slice(T)

# Copies the contents of this slice into *target*.
#
# Raises `IndexError` if the desination slice cannot fit the data being transferred
# Raises `IndexError` if the destination slice cannot fit the data being transferred
# e.g. dest.size < self.size.
#
# ```
Expand All @@ -376,7 +376,7 @@ struct Slice(T)

# Copies the contents of *source* into this slice.
#
# Raises `IndexError` if the desination slice cannot fit the data being transferred.
# Raises `IndexError` if the destination slice cannot fit the data being transferred.
@[AlwaysInline]
def copy_from(source : self)
source.copy_to(self)
Expand All @@ -396,7 +396,7 @@ struct Slice(T)
# Moves the contents of this slice into *target*. *target* and `self` may
# overlap; the copy is always done in a non-destructive manner.
#
# Raises `IndexError` if the desination slice cannot fit the data being transferred
# Raises `IndexError` if the destination slice cannot fit the data being transferred
# e.g. `dest.size < self.size`.
#
# ```
Expand All @@ -418,7 +418,7 @@ struct Slice(T)
# Moves the contents of *source* into this slice. *source* and `self` may
# overlap; the copy is always done in a non-destructive manner.
#
# Raises `IndexError` if the desination slice cannot fit the data being transferred.
# Raises `IndexError` if the destination slice cannot fit the data being transferred.
@[AlwaysInline]
def move_from(source : self)
source.move_to(self)
Expand Down
2 changes: 1 addition & 1 deletion src/socket/address.cr
Expand Up @@ -67,7 +67,7 @@ class Socket
# ```
#
# `IPAddress` won't resolve domains, including `localhost`. If you must
# resolve an IP, or don't know whether a `String` constains an IP or a domain
# resolve an IP, or don't know whether a `String` contains an IP or a domain
# name, you should use `Addrinfo.resolve` instead.
struct IPAddress < Address
UNSPECIFIED = "0.0.0.0"
Expand Down
2 changes: 1 addition & 1 deletion src/spec/expectations.cr
Expand Up @@ -380,7 +380,7 @@ module Spec
def expect_raises(klass : T.class, message : String | Regex | Nil = nil, file = __FILE__, line = __LINE__) forall T
yield
rescue ex : T
# We usually bubble Spec::AssertaionFailed, unless this is the expected exception
# We usually bubble Spec::AssertionFailed, unless this is the expected exception
if ex.is_a?(Spec::AssertionFailed) && klass != Spec::AssertionFailed
raise ex
end
Expand Down

0 comments on commit fd5e53f

Please sign in to comment.