Permalink
Browse files

random-access-lists added

  • Loading branch information...
1 parent a7b24be commit 0f5cf9706aced23f92eb6d48aad5f0d0472f146e Vincent Toups committed Dec 6, 2011
@@ -644,4 +644,11 @@ for string and buffer input."
(=>set-input new-input)
(m-return new-input))))
+(defparser (=>number equal-to)
+ "Parse an expression equal to the specific number EQUAL-TO. Fail otherwise."
+ (n <- =number)
+ (if (= n equal-to)
+ (m-return n)
+ =nil))
+
(provide 'better-monad-parse)
View
Binary file not shown.
@@ -0,0 +1,43 @@
+(require 'better-monad-parse)
+(require 'scripting)
+
+(defparser =units
+ (=>string
+ "M"
+ "uM"
+ "nM"
+ "L"
+ "mL"
+ "nL"))
+
+(defun char->trial (a)
+ (if (stringp a)
+ (char->trial (car (coerce a 'list)))
+ (- a ?a)))
+
+(defparser =maybe-letter->trial
+ (c <- (=>maybe =alpha-lower))
+ (m-return
+ (if c (char->trial c)
+ 0)))
+
+(defparser =_ (=>string "_"))
+
+(defparser =rotenone
+ (=>stringi "rotenone"
+ "rot"))
+
+(defparser =saline
+ (=>stringi "saline" "sal"))
+
+(defparser =/ (=>string "/"))
+
+(defparser (=>pluck n)
+ (in <- =input)
+ (lexical-let ((new (pluck in n)))
+ (parser
+ (=>set-input new)
+ (m-return new))))
+
+
+(provide 'parse-sombers-lab-files)
Binary file not shown.
Oops, something went wrong.

0 comments on commit 0f5cf97

Please sign in to comment.