diff --git a/DESCRIPTION b/DESCRIPTION index a41cc68..46e6400 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: thriftr Type: Package Title: Apache Thrift Client Server -Version: 1.1.3 -Date: 2019-03-08 +Version: 1.1.4 +Date: 2019-03-09 Authors@R: c(person("Marek", "Jagielski", role = c("aut", "cre", "cph"), email = "marek.jagielski@gmail.com"), diff --git a/NEWS.md b/NEWS.md index eb02df5..8407f11 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,9 @@ +### Changes in v1.1.4 + +#### BUG FIXES + + 1. Fix 'length > 1 in coercion to logical' + ### Changes in v1.1.1 #### BUG FIXES diff --git a/R/parser.R b/R/parser.R index abc781a..4632ad2 100644 --- a/R/parser.R +++ b/R/parser.R @@ -36,7 +36,7 @@ #' @export t_load <- function(path, module_name=NA, include_dirs=NA) { thrift <- parse(path, module_name, include_dirs = include_dirs) - if (length(ls(incomplete_type$dict)) > 0) { + if (length(names(incomplete_type$dict)) > 0) { fill_incomplete_ttype(thrift, thrift) } @@ -50,7 +50,7 @@ fill_incomplete_ttype <- function(tmodule, definition) { # fill incomplete ttype if (type == "list") { # fill const value - if (definition[[1]] == 'UNKNOWN_CONST') { + if (typeof(definition[[1]]) == "character" && definition[[1]] == 'UNKNOWN_CONST') { ttype <- get_definition( tmodule, incomplete_type$dict[[as.character(definition[[2]])]][[1]], definition[[4]]) return(Parser$new()$cast(ttype)(definition[[3]])) @@ -61,7 +61,7 @@ fill_incomplete_ttype <- function(tmodule, definition) { return(list(definition[[1]], get_definition(tmodule, it[[1]], it[[2]]))) } # fill service method which has incomplete arg, return ttype - else if (definition[[1]] %in% names(incomplete_type$dict)) { + else if (typeof(definition[[1]]) == "character" && definition[[1]] %in% names(incomplete_type$dict)) { it <- incomplete_type$dict[[as.character(definition[[1]])]] real_type <- get_definition(tmodule, it[[1]], it[[2]]) return(list(real_type[[1]], definition[[2]], real_type[[2]], definition[[3]])) @@ -386,7 +386,7 @@ Lexer <- R6::R6Class("Lexer", i <- i + 1 if (substr(s, i, i) %in% maps) val <- val + maps[[substr(s, i, i)]] else { - msg <- sprintf("Unexcepted escaping characher: %s", substr(s, i, i)) + msg <- sprintf("Unexcepted escaping character: %s", substr(s, i, i)) stop("[ThriftLexerError]", msg) } } else val <- paste(val, substr(s, i, i), sep = "") diff --git a/pom.xml b/pom.xml index 6b93e56..65db003 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ thriftr thriftr - 1.1.3 + 1.1.4 pom Apache Thrift Client Server