summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2017-06-24 01:11:30 -0700
committerOri Bernstein <ori@eigenstate.org>2017-06-24 09:12:52 -0700
commit969945de572d39acd871f2d9371ea81b841c538a (patch)
treeb5f6cbfe93b8fba335354e909be82bd7c8f4d21a
parent78feb233b1899dd458a1f43965e842cdd6822346 (diff)
downloadmc-969945de572d39acd871f2d9371ea81b841c538a.tar.gz
Miscellaneous typo/formatting fixes
-rw-r--r--6/simp.c2
-rw-r--r--doc/lang.txt36
-rw-r--r--mi/mi.h2
-rw-r--r--parse/gram.y2
-rw-r--r--parse/infer.c6
-rw-r--r--parse/specialize.c2
6 files changed, 25 insertions, 25 deletions
diff --git a/6/simp.c b/6/simp.c
index d277e22..3e5213e 100644
--- a/6/simp.c
+++ b/6/simp.c
@@ -988,7 +988,7 @@ static Node *simpcall(Simp *s, Node *n, Node *dst)
Type *ft;
Op op;
- /* NB: If we called rval() on a const function, , we would end up with
+ /* NB: If we called rval() on a const function, we would end up with
a stack allocated closure. We don't want to do this. */
fn = n->expr.args[0];
if (!isconstfn(fn))
diff --git a/doc/lang.txt b/doc/lang.txt
index b232f7c..c5afca4 100644
--- a/doc/lang.txt
+++ b/doc/lang.txt
@@ -124,15 +124,15 @@ TABLE OF CONTENTS:
manual.
$noret _ break
- castto const continue
- elif else extern
- false for generic
- goto if impl
- in match pkg
- pkglocal sizeof struct
- trait true type
- union use var
- void while
+ const continue elif
+ else extern false
+ for generic goto
+ if impl in
+ match pkg pkglocal
+ sizeof struct trait
+ true type union
+ use var void
+ while
Literals are a direct representation of a data object within the
source of the program. There are several literals implemented within
@@ -271,9 +271,9 @@ TABLE OF CONTENTS:
3.4. Packages and Uses
package: "pkg" ident = decl* ";;"
- use: bareuse | quoteuse
+ use: bareuse | quoteuse
bareuse: use ident
- quoteuse: use "<quoted string>"
+ quoteuse: use "<quoted string>"
There are two keywords for module system. 'use' is the simpler
@@ -392,7 +392,7 @@ TABLE OF CONTENTS:
primitivetype: misctype | inttype | flttype
misctype: "void" | "bool" | "char" | "byte"
- inttype: "int8" | "uint8" |
+ inttype: "int8" | "uint8" |
"int16" | "uint16" |
"int32" | "uint32" |
"int64" | "uint64" |
@@ -445,7 +445,7 @@ TABLE OF CONTENTS:
If the array size is specified as "...", then the array has zero bytes
allocated to store it, and bounds are not checked. This allows
flexible arrays. Flexible arrays are arrays defined at the end of
- a struct, which do not contrbute to the size of the array. When
+ a struct, which do not contribute to the size of the struct. When
allocating a struct on the heap, extra space may be reserved for
the array, allowing variable sizes of trailing data. This is not
used commonly, but turns out to be useful for C ABI comatibility.
@@ -582,7 +582,7 @@ TABLE OF CONTENTS:
specialized. For example:
trait gettable @container -> @contained =
- const get : (c : @container -> @contained)
+ get : (c : @container -> @contained)
;;
would define a trait that requires a get function which accepts
@@ -1107,8 +1107,8 @@ TABLE OF CONTENTS:
5.2.1. Summary and Precedence:
- expr: expr <binop> expr | prefixexpr | postfixexpr
- postfixexpr: <prefixop> postfixexpr
+ expr: expr <binop> expr | prefixexpr | postfixexpr
+ postfixexpr: <prefixop> postfixexpr
prefixexpr: atomicexpr <unaryop>
Myrddin expressions should be fairly familiar to most programmers.
@@ -1144,7 +1144,7 @@ TABLE OF CONTENTS:
x# Dereference
x[e] Index
x[lo:hi] Slice
- x(arg,list) Call
+ x(arg,list) Call
Precedence 10:
&x Address
@@ -1953,7 +1953,7 @@ TABLE OF CONTENTS:
pkgbody: (decl | attrs tydef | traitdef | impldef)*
/* declarations */
- decl: attrs ("var" | "const") decllist
+ decl: attrs ("var" | "const" | "generic") decllist
attrs: ("$noret" | "extern" | "pkglocal")*
decllist: declbody ("," declbody)+
declbody: declcore ["=" expr]
diff --git a/mi/mi.h b/mi/mi.h
index 6b9be4c..d9920e7 100644
--- a/mi/mi.h
+++ b/mi/mi.h
@@ -2,7 +2,7 @@ typedef struct Cfg Cfg;
typedef struct Bb Bb;
typedef struct Reaching Reaching;
-struct Cfg {
+struct Cfg {
Node *fn;
Bb **bb;
Bb *start;
diff --git a/parse/gram.y b/parse/gram.y
index aa6ee2f..428bd4b 100644
--- a/parse/gram.y
+++ b/parse/gram.y
@@ -110,7 +110,7 @@ static void setupinit(Node *n);
%token<tok> Tconst /* const */
%token<tok> Tvar /* var */
-%token<tok> Tgeneric /* var */
+%token<tok> Tgeneric /* generic */
%token<tok> Tgap /* _ */
%token<tok> Tellipsis /* ... */
diff --git a/parse/infer.c b/parse/infer.c
index 8a0bd03..bfa1852 100644
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -921,7 +921,7 @@ static void checksize(Inferstate *st, Node *ctx, Type *a, Type *b)
if (a->asize && exprop(a->asize) != Olit)
lfatal(ctx->loc, "%s: array size is not constant near %s",
tystr(a), ctxstr(st, ctx));
- if (a->asize && exprop(b->asize) != Olit)
+ if (b->asize && exprop(b->asize) != Olit)
lfatal(ctx->loc, "%s: array size is not constant near %s",
tystr(b), ctxstr(st, ctx));
if (!a->asize)
@@ -1538,11 +1538,11 @@ static void inferexpr(Inferstate *st, Node **np, Type *ret, int *sawret)
infersub(st, n, ret, sawret, &isconst);
settype(st, n, mktylike(n->loc, Tyuint));
break;
- case Ocall: /* (@a, @b, @c, ... -> @r)(@a,@b,@c, ... -> @r) -> @r */
+ case Ocall: /* (@a, @b, @c, ... -> @r)(@a, @b, @c, ...) -> @r */
infersub(st, n, ret, sawret, &isconst);
unifycall(st, n);
break;
- case Ocast: /* cast(@a, @b) -> @b */
+ case Ocast: /* (@a : @b) -> @b */
infersub(st, n, ret, sawret, &isconst);
delayedcheck(st, n, curstab());
break;
diff --git a/parse/specialize.c b/parse/specialize.c
index 654e363..e980587 100644
--- a/parse/specialize.c
+++ b/parse/specialize.c
@@ -598,7 +598,7 @@ Node *specializedcl(Node *gnode, Type *to, Node **name)
if (gnode->decl.trait) {
g = bestimpl(gnode, to);
if (!g)
- fatal(gnode, "no trait implemented for for %s:%s", namestr(gnode->decl.name), tystr(to));
+ fatal(gnode, "no trait implemented for %s:%s", namestr(gnode->decl.name), tystr(to));
} else {
g = gnode;
}