diff --git a/sexp/xt-string.go b/sexp/xt-string.go index 8423323..bb481ae 100644 --- a/sexp/xt-string.go +++ b/sexp/xt-string.go @@ -2,7 +2,7 @@ package sexp func parseString(buf []byte, offset, end int) (interface{}, int, error) { endOfString := offset - if buf[endOfString] != 0 && endOfString < end { + for buf[endOfString] != 0 && endOfString < end { endOfString = endOfString + 1 } return []string{string(buf[offset:endOfString])}, end, nil diff --git a/sexp/xt-sym-name.go b/sexp/xt-sym-name.go index b439169..caf113e 100644 --- a/sexp/xt-sym-name.go +++ b/sexp/xt-sym-name.go @@ -2,7 +2,7 @@ package sexp func parseSymName(buf []byte, offset, end int) (interface{}, int, error) { endOfString := offset - if buf[endOfString] != 0 && endOfString < end { + for buf[endOfString] != 0 && endOfString < end { endOfString = endOfString + 1 } return string(buf[offset:endOfString]), end, nil diff --git a/sexp/xt-vector.go b/sexp/xt-vector.go index 5fc7402..3f6fbd7 100644 --- a/sexp/xt-vector.go +++ b/sexp/xt-vector.go @@ -10,9 +10,9 @@ func parseVectorAttr(attr interface{}, vectorArr []interface{}, offset int) (int if !ok { return vectorArr, offset, nil } - names, ok := attrMap["n"].([]string) + names, ok := attrMap["names"].([]string) if !ok { - name, ok := attrMap["n"].(string) + name, ok := attrMap["names"].(string) if !ok { return nil, offset, errors.New("Vector names not parsed correctly") } diff --git a/sexp_parsing_test.go b/sexp_parsing_test.go index 23e8b26..57368ff 100644 --- a/sexp_parsing_test.go +++ b/sexp_parsing_test.go @@ -149,3 +149,8 @@ func TestLangTag(t *testing.T) { _, err := getResultObject("expression(2^x)") assert.Nil(t, err) } + +func TestClass(t *testing.T) { + _, err := getResultObject("setClass('test_class', slots=c(listslot='list', aslot='apNull', numslot='numeric', chrslot='character'), contains='data.frame'); j <- new('test_class'); d <- j") + assert.Nil(t, err) +} diff --git a/test/Dockerfile-RServe-Cran b/test/Dockerfile-RServe-Cran index a6ba921..becf2c4 100644 --- a/test/Dockerfile-RServe-Cran +++ b/test/Dockerfile-RServe-Cran @@ -1,8 +1,8 @@ -FROM r-base:3.2.1 +FROM r-base:3.5.1 RUN apt-get update -RUN apt-get install -y --no-install-recommends \ +RUN apt-get install -y --no-install-recommends\ libxml2-dev \ libcurl4-gnutls-dev \ libssl-dev diff --git a/test/Dockerfile-RServe-RForge b/test/Dockerfile-RServe-RForge index 23d8678..42b6efb 100644 --- a/test/Dockerfile-RServe-RForge +++ b/test/Dockerfile-RServe-RForge @@ -1,4 +1,4 @@ -FROM r-base:3.2.1 +FROM r-base:3.5.1 RUN apt-get update