diff --git a/corral/bundle/json.pony b/corral/bundle/json.pony index 8b9fc041..e4e1366c 100644 --- a/corral/bundle/json.pony +++ b/corral/bundle/json.pony @@ -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)? diff --git a/corral/semver/utils/strings.pony b/corral/semver/utils/strings.pony index 31c8782f..4e02a146 100644 --- a/corral/semver/utils/strings.pony +++ b/corral/semver/utils/strings.pony @@ -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 \ No newline at end of file + true diff --git a/corral/semver/version/consts.pony b/corral/semver/version/consts.pony index 07479b51..6e7b0c7a 100644 --- a/corral/semver/version/consts.pony +++ b/corral/semver/version/consts.pony @@ -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()) diff --git a/corral/util/action.pony b/corral/util/action.pony index 54832518..12401fde 100644 --- a/corral/util/action.pony +++ b/corral/util/action.pony @@ -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())