Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion corral/bundle/json.pony
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ primitive Json
| let e: FileErrNo => return e
end
let content: String = file.read_string(file.size())
//log.fine("Read: " + content + ".")
if file.errno() isnt FileOK then
log.err("Read File Error: ")
return JsonError
end
log.fine("Read: " + content + ". Size: " +file.size().string())
let json: JsonDoc ref = JsonDoc
try
json.parse(content)?
Expand Down
8 changes: 4 additions & 4 deletions corral/semver/utils/strings.pony
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use "collections"

primitive Strings
fun contains_only(s: String, bytes: Set[U8]): Bool =>
for byte in s.values() do
if (not bytes.contains(byte)) then return false end
fun contains_only(s: String, codepoints: Set[U32]): Bool =>
for codepoint in s.values() do
if (not codepoints.contains(codepoint)) then return false end
end
true
true
12 changes: 6 additions & 6 deletions corral/semver/version/consts.pony
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ use "collections"
// TODO: review the ponylang discussion around constants
// the runtime cost here every time is silly for what are supposed to be fixed values
primitive Consts
fun alphas(): Set[U8] =>
Set[U8].>
fun alphas(): Set[U32] =>
Set[U32].>
union("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-".values())

fun nums(): Set[U8] =>
Set[U8].>union("0123456789".values())
fun nums(): Set[U32] =>
Set[U32].>union("0123456789".values())

fun alphanums(): Set[U8] =>
Set[U8].>
fun alphanums(): Set[U32] =>
Set[U32].>
union(alphas().values()).>
union(nums().values())
4 changes: 2 additions & 2 deletions corral/util/action.pony
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@ class _Collector is ProcessNotify
None

fun ref stdout(process: ProcessMonitor ref, data: Array[U8] iso) =>
_stdout.append(consume data)
_stdout.append(String.from_iso_array(consume data))

fun ref stderr(process: ProcessMonitor ref, data: Array[U8] iso) =>
_stderr.append(consume data)
_stderr.append(String.from_iso_array(consume data))

fun ref failed(process: ProcessMonitor ref, err: ProcessError) =>
let cr = ActionResult.fail(err.string())
Expand Down