Skip to content

Commit a0615e2

Browse files
committed
parse regexp syntax into regexp call instead of re2, define regexp in stdlib
1 parent 86c23bd commit a0615e2

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

pixie/stdlib.pxi

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3072,3 +3072,10 @@ ex: (vary-meta x assoc :foo 42)"
30723072
(swap! cache assoc argsv ret)
30733073
ret)
30743074
val)))))
3075+
3076+
(defn regexp
3077+
{:doc "Returns internal representation for regular
3078+
expression, used in matching functions."
3079+
:signatures [[rexegp-str opts]]}
3080+
[regexp-str opts]
3081+
(println (str regexp-str " " opts)))

pixie/vm/reader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ def invoke(self, rdr, ch):
648648
except EOFError:
649649
break
650650

651-
return rt.cons(symbol(u"re2"), rt.cons(regex_str, rt.cons(regex_opts, nil)))
651+
return rt.cons(symbol(u"regexp"), rt.cons(regex_str, rt.cons(regex_opts, nil)))
652652

653653
dispatch_handlers = {
654654
u"{": SetReader(),

0 commit comments

Comments
 (0)