Skip to content

Commit

Permalink
mkregexp and newlinec
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafael Sevilla committed Dec 2, 2014
1 parent b8bfb24 commit 0d22a78
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion arc/bootstrap.arc
Expand Up @@ -74,8 +74,15 @@
(= (cdr ctx) (join literals (cons lit nil)))))))

;; Ought to be built-in. This is defined in terms of $ functions supported
;; by Anarki.
;; by Anarki for bootstrap purposes.
(def substring (s n (o e))
(if no.e
($ (substring s n))
($ (substring s n e))))

(def newlinec (c)
(in c #\return #\newline #\u0085 #\page #\u2028 #\u2029))

;; Make a regex. Used only for parsing.
(def mkregexp (rx flags)
(annotate 'regexp (cons rx flags)))

0 comments on commit 0d22a78

Please sign in to comment.