Skip to content

Commit

Permalink
Merge pull request #152 from nlmixr2/sigma-parse
Browse files Browse the repository at this point in the history
Fix sigma/omgea parse with boundaries
  • Loading branch information
mattfidler authored Jul 1, 2023
2 parents 3d61c01 + 6aab736 commit 3b77fa0
Show file tree
Hide file tree
Showing 4 changed files with 919 additions and 786 deletions.
5 changes: 4 additions & 1 deletion inst/omega.g
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,14 @@ omega_name: identifier '=';

omega_statement: omega_name? omega repeat? ','* singleLineComment?;

omega: omega0 | omega1 | omega2 ;
omega: omega0 | omega1 | omega2 | omega3 | omega4;

omega0: ini_constant block_type? fixed? block_type?;
omega0ignore: ini_constant block_type? fixed? block_type?;
omega1: '(' omega0 ')';
omega2: '(' block_type? fixed block_type? ini_constant ')';
omega3: '(' omega0ignore ','? omega0 ')';
omega4: '(' omega0ignore ','? omega0 ','? omega0ignore ')';

repeat: "[Xx]" decimalint;

Expand Down
4 changes: 4 additions & 0 deletions src/omega.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,10 @@ void wprint_parsetree_omega(D_ParserTables pt, D_ParseNode *pn, int depth, print
char *name = (char*)pt.symbols[pn->symbol].name;
int nch = d_get_number_of_children(pn);
#define _arg_ name, pn, pt, depth, fn, client_data
if (!strcmp("omega3", name) ||
!strcmp("omega4", name)) {
Rf_warning("Nonmem parameter boundaries for $OMEGA and $SIGMA are ignored");
}
omegaParseOmeg0(_arg_)
|| omegaParseOmega1(_arg_)
|| omegaParseOmega2(_arg_)
Expand Down
Loading

0 comments on commit 3b77fa0

Please sign in to comment.