summaryrefslogtreecommitdiff
path: root/chapter04/docs
diff options
context:
space:
mode:
authorThalia Archibald <thalia@archibald.dev>2024-06-21 06:13:09 -0700
committerGitHub <noreply@github.com>2024-06-21 14:13:09 +0100
commite5f4f7b85fbb91a293a7d89d7b85adfbaeeb51f4 (patch)
tree9b6ecc7ef37b1ec7f08efed6f908f478dc551e03 /chapter04/docs
parenta749c244bea3e2774d453165cbd18ed52863a8f5 (diff)
downloadSimple-e5f4f7b85fbb91a293a7d89d7b85adfbaeeb51f4.tar.gz
Simple-e5f4f7b85fbb91a293a7d89d7b85adfbaeeb51f4.zip
Format whitespace (#86)
* Trim trailing whitespace * Ensure final new lines * Convert line endings from CRLF to LF * Replace tabs with spaces
Diffstat (limited to 'chapter04/docs')
-rw-r--r--chapter04/docs/04-grammar.md16
-rw-r--r--chapter04/docs/04-post-peephole.gv2
-rw-r--r--chapter04/docs/04-pre-peephole.gv2
-rw-r--r--chapter04/docs/build-graphs.sh1
-rw-r--r--chapter04/docs/lattice.gv2
5 files changed, 11 insertions, 12 deletions
diff --git a/chapter04/docs/04-grammar.md b/chapter04/docs/04-grammar.md
index 51d5dbea..48facd4c 100644
--- a/chapter04/docs/04-grammar.md
+++ b/chapter04/docs/04-grammar.md
@@ -10,7 +10,7 @@ program
statement
: returnStatement
| declStatement
- | blockStatment
+ | blockStatment
| expressionStatement
| metaStatement
;
@@ -38,15 +38,15 @@ returnStatement
expression
: comparisonExpression
;
-
+
comparisonExpression
: additiveExpression (('==' | '!='| '>'| '<'| '>='| '<=') additiveExpression)*
;
-
+
additiveExpression
- : multiplicativeExpression (('+' | '-') multiplicativeExpression)*
+ : multiplicativeExpression (('+' | '-') multiplicativeExpression)*
;
-
+
multiplicativeExpression
: unaryExpression (('*' | '/') unaryExpression)*
;
@@ -66,11 +66,11 @@ INTEGER_LITERAL
: [1-9][0-9]*
| [0]
;
-
+
IDENTIFIER
: NON_DIGIT (NON_DIGIT | DIGIT)*
;
-
+
NON_DIGIT: [a-zA-Z_];
DEC_DIGIT: [0-9];
-``` \ No newline at end of file
+```
diff --git a/chapter04/docs/04-post-peephole.gv b/chapter04/docs/04-post-peephole.gv
index 51e176bc..0a9f8e93 100644
--- a/chapter04/docs/04-post-peephole.gv
+++ b/chapter04/docs/04-post-peephole.gv
@@ -40,4 +40,4 @@ return 1+arg+2; #showGraph;
Return12 -> Add11[taillabel=1];
edge [style=dashed color=cornflowerblue];
Scope1_0:"Scope1_0_arg" -> Start2:p1;
-} \ No newline at end of file
+}
diff --git a/chapter04/docs/04-pre-peephole.gv b/chapter04/docs/04-pre-peephole.gv
index b6fefc2d..aefd81c4 100644
--- a/chapter04/docs/04-pre-peephole.gv
+++ b/chapter04/docs/04-pre-peephole.gv
@@ -44,4 +44,4 @@ return 1+arg+2; #showGraph;
Return9 -> Add8[taillabel=1];
edge [style=dashed color=cornflowerblue];
Scope1_0:"Scope1_0_arg" -> Start2:p1;
-} \ No newline at end of file
+}
diff --git a/chapter04/docs/build-graphs.sh b/chapter04/docs/build-graphs.sh
index d8038602..e736a386 100644
--- a/chapter04/docs/build-graphs.sh
+++ b/chapter04/docs/build-graphs.sh
@@ -1,2 +1 @@
dot -Tsvg lattice.gv > lattice.svg
-
diff --git a/chapter04/docs/lattice.gv b/chapter04/docs/lattice.gv
index 2644448e..1f286530 100644
--- a/chapter04/docs/lattice.gv
+++ b/chapter04/docs/lattice.gv
@@ -60,4 +60,4 @@ digraph Lattice {
INT_MAX; TUPLE}
{rank=same; INT_BOT}
{rank=same; BOT;}
-} \ No newline at end of file
+}