Skip to content

Commit

Permalink
Spelling corrections (ziglang#9833)
Browse files Browse the repository at this point in the history
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
  • Loading branch information
jsoref and jsoref committed Sep 24, 2021
1 parent ef7fa76 commit 664941b
Show file tree
Hide file tree
Showing 38 changed files with 97 additions and 97 deletions.
2 changes: 1 addition & 1 deletion ci/azure/windows_msvc_script.bat
@@ -1,7 +1,7 @@
@echo on
SET "SRCROOT=%cd%"
SET "PREVPATH=%PATH%"
SET "PREVMSYSEM=%MSYSTEM%"
SET "PREVMSYSTEM=%MSYSTEM%"

set "PATH=%CD:~0,2%\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem"
SET "MSYSTEM=MINGW64"
Expand Down
24 changes: 12 additions & 12 deletions doc/langref.html.in
Expand Up @@ -2125,7 +2125,7 @@ fn dump(args: anytype) !void {

{#header_open|Multidimensional Arrays#}
<p>
Mutlidimensional arrays can be created by nesting arrays:
Multidimensional arrays can be created by nesting arrays:
</p>
{#code_begin|test|multidimensional#}
const std = @import("std");
Expand Down Expand Up @@ -2898,7 +2898,7 @@ fn bar(x: *const u3) u3 {
}
{#code_end#}
<p>
In this case, the function {#syntax#}bar{#endsyntax#} cannot be called becuse the pointer
In this case, the function {#syntax#}bar{#endsyntax#} cannot be called because the pointer
to the non-ABI-aligned field mentions the bit offset, but the function expects an ABI-aligned pointer.
</p>
<p>
Expand Down Expand Up @@ -5549,7 +5549,7 @@ test "coerce to optionals" {
}
{#code_end#}
<p>It works nested inside the {#link|Error Union Type#}, too:</p>
{#code_begin|test|test_corerce_optional_wrapped_error_union#}
{#code_begin|test|test_coerce_optional_wrapped_error_union#}
const std = @import("std");
const expect = std.testing.expect;

Expand Down Expand Up @@ -7669,7 +7669,7 @@ test "main" {
}
{#code_end#}
<p>
will ouput:
will output:
</p>
<p>
If all {#syntax#}@compileLog{#endsyntax#} calls are removed or
Expand Down Expand Up @@ -7786,7 +7786,7 @@ test "main" {
the tag value is used as the enumeration value.
</p>
<p>
If there is only one possible enum value, the resut is a {#syntax#}comptime_int{#endsyntax#}
If there is only one possible enum value, the result is a {#syntax#}comptime_int{#endsyntax#}
known at {#link|comptime#}.
</p>
{#see_also|@intToEnum#}
Expand Down Expand Up @@ -8736,7 +8736,7 @@ fn doTheTest() !void {
{#header_open|@sin#}
<pre>{#syntax#}@sin(value: anytype) @TypeOf(value){#endsyntax#}</pre>
<p>
Sine trigometric function on a floating point number. Uses a dedicated hardware instruction
Sine trigonometric function on a floating point number. Uses a dedicated hardware instruction
when available.
</p>
<p>
Expand All @@ -8747,7 +8747,7 @@ fn doTheTest() !void {
{#header_open|@cos#}
<pre>{#syntax#}@cos(value: anytype) @TypeOf(value){#endsyntax#}</pre>
<p>
Cosine trigometric function on a floating point number. Uses a dedicated hardware instruction
Cosine trigonometric function on a floating point number. Uses a dedicated hardware instruction
when available.
</p>
<p>
Expand Down Expand Up @@ -10325,7 +10325,7 @@ pub fn main() void {
<p>
Some C constructs cannot be translated to Zig - for example, <em>goto</em>,
structs with bitfields, and token-pasting macros. Zig employs <em>demotion</em> to allow translation
to continue in the face of non-translateable entities.
to continue in the face of non-translatable entities.
</p>
<p>
Demotion comes in three varieties - {#link|opaque#}, <em>extern</em>, and
Expand All @@ -10335,13 +10335,13 @@ pub fn main() void {
Functions that contain opaque types or code constructs that cannot be translated will be demoted
to {#syntax#}extern{#endsyntax#} declarations.

Thus, non-translateable types can still be used as pointers, and non-translateable functions
Thus, non-translatable types can still be used as pointers, and non-translatable functions
can be called so long as the linker is aware of the compiled function.
</p>
<p>
{#syntax#}@compileError{#endsyntax#} is used when top-level definitions (global variables,
function prototypes, macros) cannot be translated or demoted. Since Zig uses lazy analysis for
top-level declarations, untranslateable entities will not cause a compile error in your code unless
top-level declarations, untranslatable entities will not cause a compile error in your code unless
you actually use them.
</p>
{#see_also|opaque|extern|@compileError#}
Expand All @@ -10353,7 +10353,7 @@ pub fn main() void {
can be translated to Zig. Macros that cannot be translated will be be demoted to
{#syntax#}@compileError{#endsyntax#}. Note that C code which <em>uses</em> macros will be
translated without any additional issues (since Zig operates on the pre-processed source
with macros expanded). It is merely the macros themselves which may not be translateable to
with macros expanded). It is merely the macros themselves which may not be translatable to
Zig.
</p>
<p>Consider the following example:</p>
Expand All @@ -10373,7 +10373,7 @@ pub export fn foo() c_int {
}
pub const MAKELOCAL = @compileError("unable to translate C expr: unexpected token .Equal"); // macro.c:1:9
{#code_end#}
<p>Note that {#syntax#}foo{#endsyntax#} was translated correctly despite using a non-translateable
<p>Note that {#syntax#}foo{#endsyntax#} was translated correctly despite using a non-translatable
macro. {#syntax#}MAKELOCAL{#endsyntax#} was demoted to {#syntax#}@compileError{#endsyntax#} since
it cannot be expressed as a Zig function; this simply means that you cannot directly use
{#syntax#}MAKELOCAL{#endsyntax#} from Zig.
Expand Down
4 changes: 2 additions & 2 deletions src/AstGen.zig
Expand Up @@ -197,7 +197,7 @@ pub const ResultLoc = union(enum) {
none_or_ref,
/// The expression will be coerced into this type, but it will be evaluated as an rvalue.
ty: Zir.Inst.Ref,
/// Same as `ty` but it is guaranteed that Sema will additionall perform the coercion,
/// Same as `ty` but it is guaranteed that Sema will additionally perform the coercion,
/// so no `as` instruction needs to be emitted.
coerced_ty: Zir.Inst.Ref,
/// The expression must store its result into this typed pointer. The result instruction
Expand Down Expand Up @@ -479,7 +479,7 @@ fn lvalExpr(gz: *GenZir, scope: *Scope, node: Ast.Node.Index) InnerError!Zir.Ins
return expr(gz, scope, .ref, node);
}

/// Turn Zig AST into untyped ZIR istructions.
/// Turn Zig AST into untyped ZIR instructions.
/// When `rl` is discard, ptr, inferred_ptr, or inferred_ptr, the
/// result instruction can be used to inspect whether it is isNoReturn() but that is it,
/// it must otherwise not be used.
Expand Down
2 changes: 1 addition & 1 deletion src/Compilation.zig
Expand Up @@ -812,7 +812,7 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation {

const needs_c_symbols = !options.skip_linker_dependencies and is_exe_or_dyn_lib;

// WASI-only. Resolve the optinal exec-model option, defaults to command.
// WASI-only. Resolve the optional exec-model option, defaults to command.
const wasi_exec_model = if (options.target.os.tag != .wasi) undefined else options.wasi_exec_model orelse .command;

const comp: *Compilation = comp: {
Expand Down
2 changes: 1 addition & 1 deletion src/Liveness.zig
Expand Up @@ -30,7 +30,7 @@ tomb_bits: []usize,
/// The main tomb bits are still used and the extra ones are starting with the lsb of the
/// value here.
special: std.AutoHashMapUnmanaged(Air.Inst.Index, u32),
/// Auxilliary data. The way this data is interpreted is determined contextually.
/// Auxiliary data. The way this data is interpreted is determined contextually.
extra: []const u32,

/// Trailing is the set of instructions whose lifetimes end at the start of the then branch,
Expand Down
14 changes: 7 additions & 7 deletions src/Module.zig
Expand Up @@ -2188,39 +2188,39 @@ pub const LazySrcLoc = union(enum) {
node_offset_bin_op: i32,
/// The source location points to the LHS of a binary expression, found
/// by taking this AST node index offset from the containing Decl AST node,
/// which points to a binary expression AST node. Next, nagivate to the LHS.
/// which points to a binary expression AST node. Next, navigate to the LHS.
/// The Decl is determined contextually.
node_offset_bin_lhs: i32,
/// The source location points to the RHS of a binary expression, found
/// by taking this AST node index offset from the containing Decl AST node,
/// which points to a binary expression AST node. Next, nagivate to the RHS.
/// which points to a binary expression AST node. Next, navigate to the RHS.
/// The Decl is determined contextually.
node_offset_bin_rhs: i32,
/// The source location points to the operand of a switch expression, found
/// by taking this AST node index offset from the containing Decl AST node,
/// which points to a switch expression AST node. Next, nagivate to the operand.
/// which points to a switch expression AST node. Next, navigate to the operand.
/// The Decl is determined contextually.
node_offset_switch_operand: i32,
/// The source location points to the else/`_` prong of a switch expression, found
/// by taking this AST node index offset from the containing Decl AST node,
/// which points to a switch expression AST node. Next, nagivate to the else/`_` prong.
/// which points to a switch expression AST node. Next, navigate to the else/`_` prong.
/// The Decl is determined contextually.
node_offset_switch_special_prong: i32,
/// The source location points to all the ranges of a switch expression, found
/// by taking this AST node index offset from the containing Decl AST node,
/// which points to a switch expression AST node. Next, nagivate to any of the
/// which points to a switch expression AST node. Next, navigate to any of the
/// range nodes. The error applies to all of them.
/// The Decl is determined contextually.
node_offset_switch_range: i32,
/// The source location points to the calling convention of a function type
/// expression, found by taking this AST node index offset from the containing
/// Decl AST node, which points to a function type AST node. Next, nagivate to
/// Decl AST node, which points to a function type AST node. Next, navigate to
/// the calling convention node.
/// The Decl is determined contextually.
node_offset_fn_type_cc: i32,
/// The source location points to the return type of a function type
/// expression, found by taking this AST node index offset from the containing
/// Decl AST node, which points to a function type AST node. Next, nagivate to
/// Decl AST node, which points to a function type AST node. Next, navigate to
/// the return type node.
/// The Decl is determined contextually.
node_offset_fn_type_ret_ty: i32,
Expand Down
6 changes: 3 additions & 3 deletions src/Sema.zig
Expand Up @@ -11164,7 +11164,7 @@ fn getBuiltinType(
}

/// There is another implementation of this in `Type.onePossibleValue`. This one
/// in `Sema` is for calling during semantic analysis, and peforms field resolution
/// in `Sema` is for calling during semantic analysis, and performs field resolution
/// to get the answer. The one in `Type` is for calling during codegen and asserts
/// that the types are already resolved.
fn typeHasOnePossibleValue(
Expand Down Expand Up @@ -11541,7 +11541,7 @@ fn analyzeComptimeAlloc(

/// The places where a user can specify an address space attribute
pub const AddressSpaceContext = enum {
/// A function is specificed to be placed in a certain address space.
/// A function is specified to be placed in a certain address space.
function,

/// A (global) variable is specified to be placed in a certain address space.
Expand All @@ -11553,7 +11553,7 @@ pub const AddressSpaceContext = enum {
/// In contrast to .variable, values placed in this address space are not required to be mutable.
constant,

/// A pointer is ascripted to point into a certian address space.
/// A pointer is ascripted to point into a certain address space.
pointer,
};

Expand Down
14 changes: 7 additions & 7 deletions src/codegen.zig
Expand Up @@ -985,7 +985,7 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type {
// increasing the pc
const d_pc_p9 = @intCast(i64, delta_pc) - quant;
if (d_pc_p9 > 0) {
// minus one becaue if its the last one, we want to leave space to change the line which is one quanta
// minus one because if its the last one, we want to leave space to change the line which is one quanta
try dbg_out.dbg_line.append(@intCast(u8, @divExact(d_pc_p9, quant) + 128) - quant);
if (dbg_out.pcop_change_index.*) |pci|
dbg_out.dbg_line.items[pci] += 1;
Expand Down Expand Up @@ -1919,15 +1919,15 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type {
},
.shl => {
assert(!swap_lhs_and_rhs);
const shift_amout = switch (operand) {
const shift_amount = switch (operand) {
.Register => |reg_op| Instruction.ShiftAmount.reg(@intToEnum(Register, reg_op.rm)),
.Immediate => |imm_op| Instruction.ShiftAmount.imm(@intCast(u5, imm_op.imm)),
};
writeInt(u32, try self.code.addManyAsArray(4), Instruction.lsl(.al, dst_reg, op1, shift_amout).toU32());
writeInt(u32, try self.code.addManyAsArray(4), Instruction.lsl(.al, dst_reg, op1, shift_amount).toU32());
},
.shr => {
assert(!swap_lhs_and_rhs);
const shift_amout = switch (operand) {
const shift_amount = switch (operand) {
.Register => |reg_op| Instruction.ShiftAmount.reg(@intToEnum(Register, reg_op.rm)),
.Immediate => |imm_op| Instruction.ShiftAmount.imm(@intCast(u5, imm_op.imm)),
};
Expand All @@ -1936,7 +1936,7 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type {
.signed => Instruction.asr,
.unsigned => Instruction.lsr,
};
writeInt(u32, try self.code.addManyAsArray(4), shr(.al, dst_reg, op1, shift_amout).toU32());
writeInt(u32, try self.code.addManyAsArray(4), shr(.al, dst_reg, op1, shift_amount).toU32());
},
else => unreachable, // not a binary instruction
}
Expand Down Expand Up @@ -3618,7 +3618,7 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type {
try self.blocks.putNoClobber(self.gpa, inst, .{
// A block is a setup to be able to jump to the end.
.relocs = .{},
// It also acts as a receptical for break operands.
// It also acts as a receptacle for break operands.
// Here we use `MCValue.none` to represent a null value so that the first
// break instruction will choose a MCValue for the block result and overwrite
// this field. Following break instructions will use that MCValue to put their
Expand Down Expand Up @@ -3672,7 +3672,7 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type {
return self.fail("TODO: enable larger branch offset", .{});
}
},
else => unreachable, // attempting to perfrom an ARM relocation on a non-ARM target arch
else => unreachable, // attempting to perform an ARM relocation on a non-ARM target arch
}
},
}
Expand Down
2 changes: 1 addition & 1 deletion src/codegen/arm.zig
Expand Up @@ -2,7 +2,7 @@ const std = @import("std");
const DW = std.dwarf;
const testing = std.testing;

/// The condition field specifies the flags neccessary for an
/// The condition field specifies the flags necessary for an
/// Instruction to be executed
pub const Condition = enum(u4) {
/// equal
Expand Down
2 changes: 1 addition & 1 deletion src/codegen/llvm.zig
Expand Up @@ -1161,7 +1161,7 @@ pub const FuncGen = struct {
/// in other instructions. This table is cleared before every function is generated.
func_inst_table: std.AutoHashMapUnmanaged(Air.Inst.Index, *const llvm.Value),

/// These fields are used to refer to the LLVM value of the function paramaters
/// These fields are used to refer to the LLVM value of the function parameters
/// in an Arg instruction.
args: []*const llvm.Value,
arg_index: usize,
Expand Down
4 changes: 2 additions & 2 deletions src/codegen/spirv.zig
Expand Up @@ -260,7 +260,7 @@ pub const DeclGen = struct {
};
}

/// Generate the code for `decl`. If a reportable error occured during code generation,
/// Generate the code for `decl`. If a reportable error occurred during code generation,
/// a message is returned by this function. Callee owns the memory. If this function
/// returns such a reportable error, it is valid to be called again for a different decl.
pub fn gen(self: *DeclGen, decl: *Decl, air: Air, liveness: Liveness) !?*Module.ErrorMsg {
Expand Down Expand Up @@ -565,7 +565,7 @@ pub const DeclGen = struct {
}
},
// When recursively generating a type, we cannot infer the pointer's storage class. See genPointerType.
.Pointer => return self.fail("Cannot create pointer with unkown storage class", .{}),
.Pointer => return self.fail("Cannot create pointer with unknown storage class", .{}),
.Vector => {
// Although not 100% the same, Zig vectors map quite neatly to SPIR-V vectors (including many integer and float operations
// which work on them), so simply use those.
Expand Down
6 changes: 3 additions & 3 deletions src/codegen/wasm.zig
Expand Up @@ -1005,7 +1005,7 @@ pub const Context = struct {
const rhs = self.resolveInst(bin_op.rhs);

// it's possible for both lhs and/or rhs to return an offset as well,
// in which case we return the first offset occurance we find.
// in which case we return the first offset occurrence we find.
const offset = blk: {
if (lhs == .code_offset) break :blk lhs.code_offset;
if (rhs == .code_offset) break :blk rhs.code_offset;
Expand All @@ -1031,7 +1031,7 @@ pub const Context = struct {
const rhs = self.resolveInst(bin_op.rhs);

// it's possible for both lhs and/or rhs to return an offset as well,
// in which case we return the first offset occurance we find.
// in which case we return the first offset occurrence we find.
const offset = blk: {
if (lhs == .code_offset) break :blk lhs.code_offset;
if (rhs == .code_offset) break :blk rhs.code_offset;
Expand Down Expand Up @@ -1395,7 +1395,7 @@ pub const Context = struct {
}

// We map every block to its block index.
// We then determine how far we have to jump to it by substracting it from current block depth
// We then determine how far we have to jump to it by subtracting it from current block depth
const idx: u32 = self.block_depth - self.blocks.get(br.block_inst).?;
const writer = self.code.writer();
try writer.writeByte(wasm.opcode(.br));
Expand Down

0 comments on commit 664941b

Please sign in to comment.