summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/lang.txt22
-rw-r--r--parse/gram.y6
2 files changed, 25 insertions, 3 deletions
diff --git a/doc/lang.txt b/doc/lang.txt
index 7f7c59f..10be239 100644
--- a/doc/lang.txt
+++ b/doc/lang.txt
@@ -463,6 +463,9 @@ TABLE OF CONTENTS:
operator. 'e' will stand in for any expression. Unless marked
otherwise, expressions are left associative.
+ BUG: There are too many precedence levels.
+
+
Precedence 0: (*ok, not really operators)
(,,,) Tuple Construction
(e) Grouping
@@ -548,8 +551,27 @@ TABLE OF CONTENTS:
4. TYPE SYSTEM:
+ The myrddin type system is a system similar to the Hindley Milner
+ system, however, types are not implicitly generalized. Instead, type
+ schemes (type parameters, in Myrddin lingo) must be explicitly provided
+ in the declarations. For purposes of brevity, instead of specifying type
+ rules for every operator, we group operators which behave identically
+ from the type system perspective into a small set of classes
+
+ Binop:
+ + -
+
5. TOOLCHAIN:
+ The toolchain used is inspired by the Plan 9 toolchain in name. There
+ is currently one compiler for x64, called '6m'. This compiler outputs
+ standard elf .o files, and supports these options:
+
+ 6m [-h] [-o outfile] [-d[dbgopts]] inputs
+ -I path Add 'path' to use search path
+ -o Output to outfile
+
+
5. EXAMPLES:
6. STYLE GUIDE:
diff --git a/parse/gram.y b/parse/gram.y
index 2efc0ed..f9f554f 100644
--- a/parse/gram.y
+++ b/parse/gram.y
@@ -422,15 +422,15 @@ cmpexpr : cmpexpr cmpop castexpr
| castexpr
;
+
+cmpop : Teq | Tgt | Tlt | Tge | Tle | Tne ;
+
castexpr: unionexpr Tcast Toparen type Tcparen
{$$ = mkexpr($1->line, Ocast, $1, NULL);
$$->expr.type = $4;}
| unionexpr
;
-
-cmpop : Teq | Tgt | Tlt | Tge | Tle | Tne ;
-
unionexpr
: Ttick name borexpr
{$$ = mkexpr($1->line, Ocons, $2, $3, NULL);}