Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct FractionBox and other small changes #113

Merged
merged 1 commit into from
Jan 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 23 additions & 23 deletions mathics_scanner/data/operators.yml
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ ClockwiseContourIntegral:
# L-tokens: {}
# O-tokens: {""}
usage: "∲ f(x) x"
FullForm: Integrate[expr1, expr2]
# FullForm: ClockwiseContourIntegrate[expr1, expr2]
arity: Binary
affix: Compound
associativity: right
Expand Down Expand Up @@ -1313,8 +1313,8 @@ DoubleBracketingBar:
# N-tokens: {""}
# L-tokens: {}
# O-tokens: {""}
# usage: "expr"
# FullForm: "DoubleBracketingBar[expr, \[Ellipsis]]"
usage: "x, y, z"
FullForm: "DoubleBracketingBar[x, y, z]"
arity: n-ary
affix: Matchfix
associativity: null
Expand All @@ -1332,7 +1332,7 @@ DoubleContourIntegral:
# L-tokens: {}
# O-tokens: {""}
usage: "∯ f(x) x"
FullForm: Integrate[expr1, expr2]
FullForm: Integrate[x, x]
arity: Binary
affix: Compound
associativity: right
Expand Down Expand Up @@ -1940,7 +1940,7 @@ FractionBox:
WolframLanguageData-corrected: 31
UnicodeCharacters.tr:
UnicodeCharacters-corrected.tr: 590
operator: "\/"
operator: "\\/"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the important change.

usage: "\\(x\/y\\)"
arity: Binary
affix: Infix
Expand Down Expand Up @@ -2046,7 +2046,7 @@ FunctionApply:
# L-tokens: {"["}
# O-tokens: {"]"}
usage: "f [ body ]"
# FullForm: "f[expr1, \[Ellipsis]]"
FullForm: "f[body]"
arity: n-ary
affix: Postfix
associativity: left
Expand Down Expand Up @@ -2113,8 +2113,8 @@ Get:
# N-tokens: {"<<"}
# L-tokens: {}
# O-tokens: {}
# usage: "<< filename"
# FullForm: Get["filename"]
usage: "<< filename"
FullForm: Get["filename"]
arity: Unary
affix: Prefix
associativity: right
Expand Down Expand Up @@ -2425,8 +2425,8 @@ Integrate:
# N-tokens: {"∫"}
# L-tokens: {}
# O-tokens: {""}
# usage: "∫", "expr1expr2"
FullForm: Integrate[expr1, expr2]
usage: "∫ fx"
FullForm: Integrate[f, x]
arity: Binary
affix: Compound
associativity: right
Expand Down Expand Up @@ -2515,7 +2515,7 @@ InvisiblePrefixScriptBase:
affix: Prefix
associativity: right
meaningful: false
# comments: Usage and Parse may not be correct.
# comments:

Laplacian:
Precedence-Function: 670
Expand All @@ -2524,15 +2524,15 @@ Laplacian:
WolframLanguageData-corrected: 24
UnicodeCharacters.tr: 620
UnicodeCharacters-corrected.tr: 620
# N-tokens: {""}
# N-tokens: {""}
# L-tokens: {}
# O-tokens: {}
# usage: "{{"∆", "expr"}}"
usage: "∇^2_x"
arity: Unary
affix: Prefix
associativity: right
meaningful: true
# comments: Usage and Parse may not be correct.
# comments:

LeftArrow:
precedence: 270
Expand Down Expand Up @@ -2560,7 +2560,7 @@ LeftArrowBar:
# N-tokens: {}
# L-tokens: {"⇤"}
# O-tokens: {}
# usage: "x ⇤ y"
usage: "x ⇤ y"
FullForm: LeftArrowBar[x, y]
arity: Binary
affix: Infix
Expand All @@ -2577,7 +2577,7 @@ LeftArrowRightArrow:
# N-tokens: {}
# L-tokens: {"⇆"}
# O-tokens: {}
# usage: "x ⇆ y"
usage: "x ⇆ y"
FullForm: LeftArrowRightArrow[x, y]
arity: Binary
affix: Infix
Expand All @@ -2594,7 +2594,7 @@ LeftDownTeeVector:
# N-tokens: {}
# L-tokens: {"⥡"}
# O-tokens: {}
# usage: "x ⥡ y"
usage: "x ⥡ y"
FullForm: LeftDownTeeVector[x, y]
arity: Binary
affix: Infix
Expand Down Expand Up @@ -2662,7 +2662,7 @@ LeftRightVector:
# N-tokens: {}
# L-tokens: {"⥎"}
# O-tokens: {}
# usage: "x ⥎ y"
usage: "x ⥎ y"
FullForm: LeftRightVector[x, y]
arity: Binary
affix: Infix
Expand All @@ -2679,7 +2679,7 @@ LeftTee:
# N-tokens: {}
# L-tokens: {"⊣"}
# O-tokens: {}
# usage: "expr1 ⊣ expr2"
usage: "expr1 ⊣ expr2"
FullForm: LeftTee[expr1, expr2]
arity: Binary
affix: Infix
Expand All @@ -2696,7 +2696,7 @@ LeftTeeArrow:
# N-tokens: {}
# L-tokens: {"↤"}
# O-tokens: {}
# usage: "x ↤ y"
usage: "x ↤ y"
FullForm: LeftTeeArrow[x, y]
arity: Binary
affix: Infix
Expand Down Expand Up @@ -2764,7 +2764,7 @@ LeftTriangleEqual:
# N-tokens: {}
# L-tokens: {"⊴"}
# O-tokens: {}
# usage: "x ⊴ y"
usage: "x ⊴ y"
FullForm: LeftTriangleEqual[x, y]
arity: Binary
affix: Infix
Expand Down Expand Up @@ -3037,8 +3037,8 @@ List:
# N-tokens: {"{"}
# L-tokens: {}
# O-tokens: {"}"}
# usage: "{ expr }"
FullForm: List[expr, \[Ellipsis]]
usage: "{ a, b, c }"
FullForm: List[a, b, c]
arity: n-ary
affix: Matchfix
associativity: null
Expand Down
2 changes: 1 addition & 1 deletion mathics_scanner/tokeniser.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ def __eq__(self, other):
)

def __repr__(self):
return f"Token({self.tag}, {self.text}, {self.pos})"
return f"Token({repr(self.tag)}, {repr(self.text)}, {self.pos})"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a slightly nicer repr which makes clear which parts (tag and text) are strings.



class Tokeniser:
Expand Down
Loading