Skip to content

Commit

Permalink
Merge pull request #189 from nlmixr2/188-abbrev-err
Browse files Browse the repository at this point in the history
Fix the Replace grammar to accept ETA(#) on rhs
  • Loading branch information
mattfidler authored Nov 28, 2024
2 parents a5709e4 + 3371ac1 commit d971557
Show file tree
Hide file tree
Showing 6 changed files with 775 additions and 543 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: nonmem2rx
Type: Package
Title: Converts 'NONMEM' Models to 'rxode2'
Version: 0.1.5
Version: 0.1.5.9000
Maintainer: Matthew Fidler <[email protected]>
Authors@R: c(person("Matthew","Fidler", role = c("aut", "cre"), email = "[email protected]", comment=c(ORCID="0000-0001-8538-6691")),
person("Philip", "Delff", email = "[email protected]",role = c("ctb")),
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# nonmem2rx (development version)

* Add more flexible replacement of ETA and other values #188

* Add ability to use `nonmem2rx` with a NONMEM control stream text input

# nonmem2rx 0.1.5

* Be more forgiving in the validation and remove IDs without
Expand Down
6 changes: 6 additions & 0 deletions R/nonmem2rx.R
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,12 @@ nonmem2rx <- function(file, inputData=NULL, nonmemOutputDir=NULL,
load=getOption("nonmem2rx.load", TRUE),
compress=getOption("nonmem2rx.compress", TRUE),
keep=getOption("nonmem2rx.keep", c("dfSub", "dfObs", "thetaMat", "sigma"))) {
if (any(grepl("[$][Pp][Rr][Oo][Bb][Ll][Ee][Mm]", file))) {
.file <- tempfile(fileext=".ctl")
writeLines(gsub("[ \t]+[$]", "$", file), .file)
file <- .file
on.exit(unlink(.file))
}
.pt <- proc.time()
.ret <- .collectWarn({
checkmate::assertFileExists(file)
Expand Down
3 changes: 1 addition & 2 deletions inst/abbrec.g
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ seq_nm: decimalint (':' | 'TO' | 'to' | 'To') decimalint
seq_arg: '(' ','* (seq_nm | decimalint) (',' (seq_nm | decimalint))* ')';

replace_direct1: var_replace '(' identifier_nm ')' '=' var_replace '(' decimalintNo0 ')';
replace_direct2: identifier_nm '=' (identifier_nm | constantneg);
replace_direct2: identifier_nm '=' (identifier_nm | constantneg | var_replace '(' decimalintNo0 ')');
replace_direct3: identifier_nm '=' string;

replace_data: var_rep2 '(' identifier_nm ')' '=' var_rep2 (seq_arg | dec_arg);
Expand All @@ -70,4 +70,3 @@ decimalintNo0: "([1-9][0-9]*)" $term -1;
decimalint: "0|([1-9][0-9]*)" $term -1;
float1: "([0-9]+.[0-9]*|[0-9]*.[0-9]+)([eE][\-\+]?[0-9]+)?" $term -2;
float2: "[0-9]+[eE][\-\+]?[0-9]+" $term -3;

Loading

0 comments on commit d971557

Please sign in to comment.