summaryrefslogtreecommitdiff
path: root/libregex
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-06-12 12:46:50 -0400
committerOri Bernstein <ori@eigenstate.org>2015-06-12 14:01:54 -0400
commit21b91ad9fa7ae830272dc67fbe3150dc30921702 (patch)
treea674ea3e28f90ba8fa2f4521069a010b4742961e /libregex
parent96c8217e913d8d6de22bbb1aa3624c26e66838fc (diff)
downloadmc-21b91ad9fa7ae830272dc67fbe3150dc30921702.tar.gz
Move fmt to fmt2.
Shit seems to work.
Diffstat (limited to 'libregex')
-rw-r--r--libregex/compile.myr72
-rw-r--r--libregex/interp.myr2
-rw-r--r--libregex/redump.myr10
3 files changed, 42 insertions, 42 deletions
diff --git a/libregex/compile.myr b/libregex/compile.myr
index ed69432..172844d 100644
--- a/libregex/compile.myr
+++ b/libregex/compile.myr
@@ -168,21 +168,21 @@ const rtdump = {rt, ind
var l, h
indent(ind)
- std.f2put("Range (end = {}) {{\n", rt.end)
+ std.put("Range (end = {}) {{\n", rt.end)
for i = 0; i < rt.ranges.len; i++
indent(ind + 1)
(l, h) = rt.ranges[i]
- std.f2put("0x{x}-0x{x}: \n", l, h)
+ std.put("0x{x}-0x{x}: \n", l, h)
rtdump(rt.link[i], ind + 1)
;;
indent(ind)
- std.f2put("}\n")
+ std.put("}\n")
}
const indent = {ind
var i
for i = 0; i < ind; i++
- std.f2put("\t")
+ std.put("\t")
;;
}
@@ -373,28 +373,28 @@ const idump = {re
->
;;
for i = 0; i < re.proglen; i++
- std.f2put("{}:\t", i)
+ std.put("{}:\t", i)
match re.prog[i]
/* Char matching. Consume exactly one byte from the string. */
- | `Ibyte b: std.f2put("`Ibyte {} ({})\n", b, b castto(char))
+ | `Ibyte b: std.put("`Ibyte {} ({})\n", b, b castto(char))
| `Irange (start, end):
- std.f2put("`Irange ({},{})", start, end)
+ std.put("`Irange ({},{})", start, end)
if std.isalnum(start castto(char)) && std.isalnum(end castto(char))
- std.f2put("\t/* {}-{} */", start castto(char), end castto(char))
+ std.put("\t/* {}-{} */", start castto(char), end castto(char))
;;
- std.f2put("\n")
+ std.put("\n")
/* capture groups */
- | `Ilbra m: std.f2put("`Ilbra {}\n", m)
- | `Irbra m: std.f2put("`Irbra {}\n", m)
+ | `Ilbra m: std.put("`Ilbra {}\n", m)
+ | `Irbra m: std.put("`Irbra {}\n", m)
/* anchors */
- | `Ibol: std.f2put("`Ibol\n")
- | `Ieol: std.f2put("`Ieol\n")
- | `Ibow: std.f2put("`Ibow\n")
- | `Ieow: std.f2put("`Ieow\n")
+ | `Ibol: std.put("`Ibol\n")
+ | `Ieol: std.put("`Ieol\n")
+ | `Ibow: std.put("`Ibow\n")
+ | `Ieow: std.put("`Ieow\n")
/* control flow */
- | `Ifork (lip, rip): std.f2put("`Ifork ({},{})\n", lip, rip)
- | `Ijmp ip: std.f2put("`Ijmp {}\n", ip)
- | `Imatch id: std.f2put("`Imatch {}\n", id)
+ | `Ifork (lip, rip): std.put("`Ifork ({},{})\n", lip, rip)
+ | `Ijmp ip: std.put("`Ijmp {}\n", ip)
+ | `Imatch id: std.put("`Imatch {}\n", id)
;;
;;
}
@@ -407,58 +407,58 @@ const dump = {re, t, indent
->
;;
for i = 0; i < indent; i++
- std.f2put(" ")
+ std.put(" ")
;;
match t#
| `Alt (a, b):
- std.f2put("Alt\n")
+ std.put("Alt\n")
dump(re, a, indent + 1)
dump(re, b, indent + 1)
| `Cat (a, b):
- std.f2put("Cat\n")
+ std.put("Cat\n")
dump(re, a, indent + 1)
dump(re, b, indent + 1)
/* repetition */
| `Star a:
- std.f2put("Star\n")
+ std.put("Star\n")
dump(re, a, indent + 1)
| `Rstar a:
- std.f2put("Rstar\n")
+ std.put("Rstar\n")
dump(re, a, indent + 1)
| `Plus a:
- std.f2put("Plus\n")
+ std.put("Plus\n")
dump(re, a, indent + 1)
| `Rplus a:
- std.f2put("Rplus\n")
+ std.put("Rplus\n")
dump(re, a, indent + 1)
| `Quest a:
- std.f2put("Quest\n")
+ std.put("Quest\n")
dump(re, a, indent + 1)
| `Bol:
- std.f2put("Bol\n")
+ std.put("Bol\n")
| `Eol:
- std.f2put("Eol\n")
+ std.put("Eol\n")
| `Bow:
- std.f2put("Bow\n")
+ std.put("Bow\n")
| `Eow:
- std.f2put("Eow\n")
+ std.put("Eow\n")
/* end matches */
| `Byte b:
- std.f2put("Byte {}\n", b)
+ std.put("Byte {}\n", b)
| `Chr c:
- std.f2put("Char {}\n", c)
+ std.put("Char {}\n", c)
| `Ranges rl:
- std.f2put("Ranges")
+ std.put("Ranges")
for r in rl
for i = 0; i < indent + 1; i++
- std.f2put(" ")
+ std.put(" ")
;;
- std.f2put("\t({}-{})\n", r[0], r[1])
+ std.put("\t({}-{})\n", r[0], r[1])
;;
/* meta */
| `Cap (m, a):
- std.f2put("Cap {}\n", m)
+ std.put("Cap {}\n", m)
dump(re, a, indent + 1)
;;
}
diff --git a/libregex/interp.myr b/libregex/interp.myr
index efd7cf8..fc179c0 100644
--- a/libregex/interp.myr
+++ b/libregex/interp.myr
@@ -289,7 +289,7 @@ const trace : (re : regex#, thr : rethread#, msg : byte[:], args : ... -> void)
if re.debug
ap = std.vastart(&args)
- std.f2putv(msg, &ap)
+ std.putv(msg, &ap)
;;
}
diff --git a/libregex/redump.myr b/libregex/redump.myr
index 416d8a9..7f7ed40 100644
--- a/libregex/redump.myr
+++ b/libregex/redump.myr
@@ -13,7 +13,7 @@ const main = {args
cmd = std.optparse(args, &opts)
match regex.dbgcompile(cmd.args[0])
| `std.Fail m:
- std.f2fatal("unable to compile regex: {}\n", regex.failmsg(m))
+ std.fatal("unable to compile regex: {}\n", regex.failmsg(m))
| `std.Ok re:
if cmd.args.len > 1
runall(re, cmd.args)
@@ -33,7 +33,7 @@ const runall = {re, files
dump(re, fd)
bio.close(fd)
| `std.None:
- std.f2fatal("failed to open {}\n", f)
+ std.fatal("failed to open {}\n", f)
;;
;;
}
@@ -55,11 +55,11 @@ const show = {mg
match mg
| `std.Some rl:
- std.f2put("Matched: {}\n", rl[0])
+ std.put("Matched: {}\n", rl[0])
for i = 1; i < rl.len; i++
- std.f2put("group {}: {}\n", i, rl[i])
+ std.put("group {}: {}\n", i, rl[i])
;;
| `std.None:
- std.f2put("Match failed\n")
+ std.put("Match failed\n")
;;
}