aboutsummaryrefslogtreecommitdiff
path: root/vb/reader.vb
diff options
context:
space:
mode:
authorJoel Martin <github@martintribe.org>2014-12-18 20:33:49 -0600
committerJoel Martin <github@martintribe.org>2015-01-09 16:16:50 -0600
commitb8ee29b22fbaa7a01f2754b4d6dd9af52e02017c (patch)
treef4d977ed220e9a3f665cfbf4f68770a81e4c2095 /vb/reader.vb
parentaaba249304b184e12e2445ab22d66df1f39a51a5 (diff)
downloadmal-b8ee29b22fbaa7a01f2754b4d6dd9af52e02017c.tar.gz
mal-b8ee29b22fbaa7a01f2754b4d6dd9af52e02017c.zip
All: add keywords.
Also, fix nth and count to match cloure.
Diffstat (limited to 'vb/reader.vb')
-rw-r--r--vb/reader.vb6
1 files changed, 4 insertions, 2 deletions
diff --git a/vb/reader.vb b/vb/reader.vb
index 121aac2..9d4e03d 100644
--- a/vb/reader.vb
+++ b/vb/reader.vb
@@ -64,7 +64,7 @@ Namespace Mal
Shared Function read_atom(rdr As Reader) As MalVal
Dim token As String = rdr.get_next()
- Dim pattern As String = "(^-?[0-9]+$)|(^-?[0-9][0-9.]*$)|(^nil$)|(^true$)|(^false$)|^("".*"")$|(^[^""]*$)"
+ Dim pattern As String = "(^-?[0-9]+$)|(^-?[0-9][0-9.]*$)|(^nil$)|(^true$)|(^false$)|^("".*"")$|^:(.*)|(^[^""]*$)"
Dim regex As Regex = New Regex(pattern)
Dim match As Match = regex.Match(token)
'Console.WriteLine("token: ^" + token + "$")
@@ -86,7 +86,9 @@ Namespace Mal
.Replace("\""", """") _
.Replace("\n", Environment.NewLine))
Else If match.Groups(7).Value <> String.Empty Then
- return New Mal.types.MalSymbol(match.Groups(7).Value)
+ return New Mal.types.MalString(ChrW(&H029e) & match.Groups(7).Value)
+ Else If match.Groups(8).Value <> String.Empty Then
+ return New Mal.types.MalSymbol(match.Groups(8).Value)
Else
throw New ParseError("unrecognized '" & match.Groups(0).Value & "'")
End If