diff options
author | John Denker <jsd@av8n.com> | 2021-11-11 14:17:28 -0700 |
---|---|---|
committer | John Denker <jsd@av8n.com> | 2021-11-11 16:08:19 -0700 |
commit | 540b67046c2e94e8198b2ade7b3d9fcae315c36b (patch) | |
tree | 77028aaee1f91fcf98c2d437e1613b4450dac33f /parser.php | |
parent | 22665704696c4c404142156217401cda5be697e6 (diff) |
fix it so that -(123) shows correctly,
i.e. not dropping the - sign
Diffstat (limited to 'parser.php')
-rw-r--r-- | parser.php | 25 |
1 files changed, 17 insertions, 8 deletions
@@ -1378,15 +1378,24 @@ class qtype_algebra_parser_bracket extends qtype_algebra_parser_term { // Static class properties. const NARGS = 1; private static $formats = array( - '(' => array('str' => '(%s)', - 'tex' => '\\left( %s \\right)'), - '[' => array('str' => '[%s]', - 'tex' => '\\left[ %s \\right]'), - '{' => array('str' => '{%s}', - 'tex' => '\\left\\lbrace %s \\right\\rbrace'), - '<' => array('str' => '(%s)', - 'tex' => '{%s}') + '(' => array('str' => '%s(%s)', + 'tex' => '%s\\left( %s \\right)'), + '[' => array('str' => '%s[%s]', + 'tex' => '%s\\left[ %s \\right]'), + '{' => array('str' => '%s{%s}', + 'tex' => '%s\\left\\lbrace %s \\right\\rbrace'), + '<' => array('str' => '%s(%s)', + 'tex' => '%s{%s}') ); + + public function print_args($method) { + $args = array($this->_sign); + foreach ($this->_arguments as $arg) { + $args[] = $arg->$method(); + } + // Return the array of arguments. + return $args; + } } |