asciidoctor / asciimath

Asciimath parser
MIT License
24 stars 16 forks source link

frac()() does not appear to be implemented #70

Closed opoudjis closed 2 years ago

opoudjis commented 2 years ago

root(x)(y) is implemented, and there is code to handle it: append_root

However, while the symbol frac is recognised as a binary symbol, there is no corresponding code to process :frac: under https://github.com/asciidoctor/asciimath/blob/d3fd7ac8a1d9d83a799b63631d700f1cf5be8c1c/lib/asciimath/markup.rb#L380

I'm assuming all that needs to be done is:

 when ::AsciiMath::AST::BinaryOp
          if (symbol = resolve_symbol(node.operator))
            case symbol[:type]
              when :over
                append_underover(node.operand2, nil, node.operand1)
              when :under
                append_underover(node.operand2, node.operand1, nil)
              when :root
                append_root(node.operand2, node.operand1)
              when :frac
                append_fraction(node.operand1, node.operand2)
              when :color
                append_color(node.operand1.to_hex_rgb, node.operand2)
            end
          end