Skip to content

MathQuill parser parses sin x^2 incorrectly #1

@nathancarter

Description

@nathancarter

The MathQuill parser does not correctly prioritize exponentiation over trig function application.

Input: sin x sup 2

Output:

<OMA>
  <OMS cd="arith1" name="power"/>
  <OMA>
    <OMS cd="transc1" name="sin"/>
    <OMV name="x"/>
  </OMA>
  <OMI>2</OMI>
</OMA>

Expected output:

<OMA>
  <OMS cd="transc1" name="sin"/>
  <OMA>
    <OMS cd="arith1" name="power"/>
    <OMV name="x"/>
    <OMI>2</OMI>
  </OMA>
</OMA>

Steps we should take:

  1. Add a unit test to demonstrate this failure.
  2. Fix the definition in the source code.
  3. Ensure the new unit test now passes.
  4. Commit and push.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions