diff --git a/inst/sub.g b/inst/sub.g index 60d6dd9e..e0171cad 100644 --- a/inst/sub.g +++ b/inst/sub.g @@ -1,7 +1,7 @@ //loop statement_list : (statement)+ ; -statement: advan_statement +statement: advan_statement | trans_statement | tol_statement | atol_statement @@ -47,7 +47,7 @@ sstol_statement2: sstol_keyword '=' nonSpace; sstol_statement: sstol_statement1 | sstol_statement2 | sstol_statement3; unsupported_subnames: 'SS' | 'PK' | 'ERROR' | 'DES' | 'AES' | 'INFN' | 'MODEL' - 'ss' | 'pk' | 'error' | 'des' | 'aes' | 'infn' | 'model' | + 'ss' | 'pk' | 'error' | 'des' | 'aes' | 'infn' | 'model' | 'Ss' | 'Pk' | 'Error' | 'Des' | 'Aes' | 'Infn' | 'Model'; unsupported_statement: unsupported_subnames '=' nonSpace; @@ -56,7 +56,7 @@ decimalint: "0|([1-9][0-9]*)" $term -1; string: "\"([^\"\\]|\\[^])*\""; float1: "([0-9]+.[0-9]*|[0-9]*.[0-9]+)([eE][\-\+]?[0-9]+)?" $term -2; float2: "[0-9]+[eE][\-\+]?[0-9]+" $term -3; -whitespace: ( "[ \t\r\n]+" | singleLineComment )*; +whitespace: ( "[ \t\r\n, ]+" | singleLineComment )*; singleLineComment: ';' "[^\n]*"; nonSpace: "[^0-9 \n][^ \n]*"; identifier_nm: "[a-zA-Z][a-zA-Z0-9_]*" $term -4; diff --git a/src/sub.g.d_parser.h b/src/sub.g.d_parser.h index e9767080..8d5c8b4c 100644 --- a/src/sub.g.d_parser.h +++ b/src/sub.g.d_parser.h @@ -1022,14 +1022,14 @@ d_accepts_diff_82_0_nonmem2rxSub unsigned char d_scanner_82_0_0_nonmem2rxSub[SCANNER_BLOCK_SIZE] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, }; unsigned char d_scanner_82_1_0_nonmem2rxSub[SCANNER_BLOCK_SIZE] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; @@ -2526,7 +2526,7 @@ D_Symbol d_symbols_nonmem2rxSub[] = { {D_SYMBOL_REGEX, "\\\"([^\\\"\\\\\\\\]|\\\\\\\\[^])*\\\"", 38, -1}, {D_SYMBOL_REGEX, "([0-9]+.[0-9]*|[0-9]*.[0-9]+)([eE][\\\\-\\\\+]?[0-9]+)?", 55, -1}, {D_SYMBOL_REGEX, "[0-9]+[eE][\\\\-\\\\+]?[0-9]+", 29, -1}, -{D_SYMBOL_REGEX, "[ \\t\\r\\n]+", 13, -1}, +{D_SYMBOL_REGEX, "[ \\t\\r\\n, ]+", 15, -1}, {D_SYMBOL_STRING, ";", 1, -1}, {D_SYMBOL_REGEX, "[^\\n]*", 7, -1}, {D_SYMBOL_REGEX, "[^0-9 \\n][^ \\n]*", 18, -1}, diff --git a/tests/testthat/test-sub.R b/tests/testthat/test-sub.R index e8458d37..90b93166 100644 --- a/tests/testthat/test-sub.R +++ b/tests/testthat/test-sub.R @@ -13,6 +13,7 @@ test_that("test sub", { expect_error(.s("tranvan1")) + .s("ADVAN1,TRANS2", c(advan=1L, trans=2L, abbrevLin=1L)) .s("ADVAN1 TRANS1", c(advan=1L, trans=1L, abbrevLin=1L)) .s("ADVAN1 TRANS2", c(advan=1L, trans=2L, abbrevLin=1L)) .s("ADVAN=ADVAN1 TRANS=TRANS2", c(advan=1L, trans=2L, abbrevLin=1L))