about summary refs log tree commit diff stats
path: root/baremetal/shell/read.mu
diff options
context:
space:
mode:
Diffstat (limited to 'baremetal/shell/read.mu')
-rw-r--r--baremetal/shell/read.mu121
1 files changed, 120 insertions, 1 deletions
diff --git a/baremetal/shell/read.mu b/baremetal/shell/read.mu
index 6b1a0a82..19a38501 100644
--- a/baremetal/shell/read.mu
+++ b/baremetal/shell/read.mu
@@ -88,7 +88,8 @@ fn next-symbol-token in: (addr gap-buffer), out: (addr stream byte), trace: (add
 }
 
 fn is-symbol-grapheme? g: grapheme -> _/eax: boolean {
-  compare g, 0x20/space
+  ## whitespace
+  compare g, 9/tab
   {
     break-if-!=
     return 0/false
@@ -98,11 +99,28 @@ fn is-symbol-grapheme? g: grapheme -> _/eax: boolean {
     break-if-!=
     return 0/false
   }
+  compare g, 0x20/space
+  {
+    break-if-!=
+    return 0/false
+  }
+  ## quotes
   compare g, 0x22/double-quote
   {
     break-if-!=
     return 0/false
   }
+  compare g, 0x27/single-quote
+  {
+    break-if-!=
+    return 0/false
+  }
+  compare g, 0x60/backquote
+  {
+    break-if-!=
+    return 0/false
+  }
+  ## brackets
   compare g, 0x28/open-paren
   {
     break-if-!=
@@ -133,6 +151,107 @@ fn is-symbol-grapheme? g: grapheme -> _/eax: boolean {
     break-if-!=
     return 0/false
   }
+  # - other punctuation
+  # '!' is a symbol char
+  compare g, 0x23/hash
+  {
+    break-if-!=
+    return 0/false
+  }
+  # '$' is a symbol char
+  compare g, 0x25/percent
+  {
+    break-if-!=
+    return 0/false
+  }
+  compare g, 0x26/ampersand
+  {
+    break-if-!=
+    return 0/false
+  }
+  compare g, 0x2a/asterisk
+  {
+    break-if-!=
+    return 0/false
+  }
+  compare g, 0x2b/plus
+  {
+    break-if-!=
+    return 0/false
+  }
+  compare g, 0x2c/comma
+  {
+    break-if-!=
+    return 0/false
+  }
+  # '-' is a symbol char
+  compare g, 0x2e/period
+  {
+    break-if-!=
+    return 0/false
+  }
+  compare g, 0x2f/slash
+  {
+    break-if-!=
+    return 0/false
+  }
+  compare g, 0x2f/slash
+  {
+    break-if-!=
+    return 0/false
+  }
+  compare g, 0x3a/colon
+  {
+    break-if-!=
+    return 0/false
+  }
+  compare g, 0x3b/semi-colon
+  {
+    break-if-!=
+    return 0/false
+  }
+  compare g, 0x3c/less-than
+  {
+    break-if-!=
+    return 0/false
+  }
+  compare g, 0x3d/equal
+  {
+    break-if-!=
+    return 0/false
+  }
+  compare g, 0x3e/greater-than
+  {
+    break-if-!=
+    return 0/false
+  }
+  # '?' is a symbol char
+  compare g, 0x40/at-sign
+  {
+    break-if-!=
+    return 0/false
+  }
+  compare g, 0x5c/backslash
+  {
+    break-if-!=
+    return 0/false
+  }
+  compare g, 0x5e/caret
+  {
+    break-if-!=
+    return 0/false
+  }
+  # '_' is a symbol char
+  compare g, 0x7c/vertical-line
+  {
+    break-if-!=
+    return 0/false
+  }
+  compare g, 0x7e/tilde
+  {
+    break-if-!=
+    return 0/false
+  }
   return 1/true
 }
 
id=d64124e97bdf26169f20e98fbdf1af934b265b74'>^
05649a5 ^
9ee17f1 ^







5b59ba3 ^




9ee17f1 ^


05649a5 ^
251f72e ^


9ee17f1 ^

07511f9 ^






251f72e ^
07511f9 ^




1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69