Skip to contents

Removes everything between $ontext and $offtext, inclusive.

Usage

remove_ontext_offtext(lines)

Arguments

lines

Character vector of GAMS source lines.

Value

The lines with block comments removed.

Details

Exported because consumers that parse GAMS sources of their own - energyRt's model code, for one - need the same treatment before scanning for domain hints, and duplicating it would let the two drift.

Examples

remove_ontext_offtext(c("a;", "$ontext", "note", "$offtext", "b;"))
#> [1] "a;" "b;"