Skip to content

Commit

Permalink
More operator information
Browse files Browse the repository at this point in the history
  • Loading branch information
rocky committed Aug 30, 2024
1 parent 46468c4 commit 7fc117f
Show file tree
Hide file tree
Showing 3 changed files with 127 additions and 22 deletions.
2 changes: 1 addition & 1 deletion mathics_scanner/data/OperatorTable.csv
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ PartialUnderscriptBox,PartialUnderscriptBox,950,670,710,,7,,790,{},"{""""}",{
UnderscriptBox,Underscript,950,670,710,7,7,,790,{},"{""\+""}",{},"{{""expr1"", ""\+"", ""expr2""}}","{""UnderscriptBox"", ""["", ""expr1"", "","", ""expr2"", ""]""}",,Binary,Infix,"Missing[""Unknown""]",True,
OverunderscriptBox,Underoverscript,940,670,700,7,7.5,,785,{},"{""\&""}","{""\%""}","{{""expr1"", ""\&"", ""expr2"", ""\%"", ""expr3""}}","{""UnderoverscriptBox"", ""["", ""expr1"", "","", ""expr3"", "","", ""expr2"", ""]""}",,Ternary,Infix,"Missing[""Unknown""]",True,
UnderoverscriptBox,Underoverscript,940,670,700,7,7.5,,785,{},"{""\+""}","{""\%""}","{{""expr1"", ""\+"", ""expr2"", ""\%"", ""expr3""}}","{""UnderoverscriptBox"", ""["", ""expr1"", "","", ""expr2"", "","", ""expr3"", ""]""}",,Ternary,Infix,"Missing[""Unknown""]",True,
InterpretBoxes,None,930,670,695,,7.6,,780,"{""\*""}",{},{},"{{""\*"", ""expr""}}",,,Unary,Prefix,Right,True,
InterpretationBox,None,930,670,695,,7.6,,780,"{""\*""}",{},{},"{{""\*"", ""expr""}}",,,Unary,Prefix,Right,True,
PartialSubscriptBox,PartialSubscriptBox,920,670,690,,8,,775,{},"{""""}",{},"{{""expr"", """"}}","{""FractionBox"", ""["", ""expr"", "",""\["", ""Placeholder"", ""]""]""}",,Unary,Postfix,Left,False,This operator is an invisible Unicode character and is used in the layout of displayed expressions.
SubscriptBox,Subscript,920,670,690,8,8,,775,{},"{""\_""}",{},"{{""expr1"", ""\_"", ""expr2""}}","{""SubscriptBox"", ""["", ""expr1"", "","", ""expr2"", ""]""}",,Binary,Infix,"Missing[""Unknown""]",True,
SubsuperscriptBox,Subsuperscript,920,670,690,8,8,,775,{},"{""\_""}","{""\%""}","{{""expr1"", ""\_"", ""expr2"", ""\%"", ""expr3""}}","{""SubsuperscriptBox"", ""["", ""expr1"", "","", ""expr2"", "","", ""expr3"", ""]""}",,Ternary,Infix,"Missing[""Unknown""]",True,
Expand Down
77 changes: 71 additions & 6 deletions mathics_scanner/data/operators-additional.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,52 @@
# Note: we keep the misspelling of "meaningfull"
# and the uncoverted types like None and True

Postfix:
name: Postfix
Derivative:
name: Derivative
actual-precedence: 770
Precedence: 670 # CSV has 604 which is wrong
Precedence-Function: 670
WolframLanguageData: 19
WolframLanguageData-corrected: 19
UnicodeCharacters.tr:
UnicodeCharacters-corrected.tr: 680
# N-tokens: {}
# L-tokens: {"''"}
# O-tokens: {}
# usage: {{"expr", "''"}}
# parse: {"Derivative", "[", "n", "]", "[", "expr", "]"}
# FullForm: Derivative[n][expr]
arity: Unary
affix: Postfix
associativity: left
meaningfull: "true"
# comments:

# This operator is a little sketchy
Information:
name: Information
actual-precedence: 670
Precedence: 670
Precedence-corrected: 670
WolframLanguageData: null
WolframLanguageData-corrected:
UnicodeCharacters.tr:
UnicodeCharacters-corrected.tr:
# N-tokens:
# L-tokens:
# O-tokens:
# usage: "?? AddTo"
# parse: {"Information", "[", "AddTo", "]"}
# FullForm: Information[AddTo]
arity: Binary
affix: Infix
associativity: None
meaningfull: "true"
# comments:

# This operator is a little sketchy
InterpretedBox:
name: InterpretedBox
actual-precedence: 670
Precedence: 670
Precedence-corrected: 670
Expand All @@ -15,7 +59,7 @@ Postfix:
# N-tokens:
# L-tokens:
# O-tokens:
# usage: {{"expr", "//", "FormName"}}
# usage: "\! \(2+2\)"
# parse: {"FullForm", "[", "expr1", "]"}
# FullForm: FullForm[expr]
arity: Binary
Expand All @@ -24,8 +68,8 @@ Postfix:
meaningfull: "true"
# comments:

Prefix:
name: Prefix
Postfix:
name: Postfix
actual-precedence: 640
Precedence: 640
Precedence-corrected: 640
Expand All @@ -36,11 +80,32 @@ Prefix:
# N-tokens:
# L-tokens:
# O-tokens:
# usage: {{"expr", "//", "FormName"}}
usage: "expr // FormName"
# parse: {"FullForm", "[", "expr1", "]"}
# FullForm: FullForm[expr]
arity: Binary
affix: Infix
associativity: None
meaningfull: "true"
# comments:

Prefix:
name: Prefix
actual-precedence: 640
Precedence: 640
Precedence-corrected: 640
WolframLanguageData: null
WolframLanguageData-corrected:
UnicodeCharacters.tr:
UnicodeCharacters-corrected.tr:
# N-tokens:
# L-tokens:
# O-tokens:
usage: "expr1 @ expr2"
# parse: {"expr1", "[", "expr2", "]"}
# FullForm: expr1[expr2]
arity: Binary
affix: Infix
associativity: None
meaningfull: "true"
# comments:
70 changes: 55 additions & 15 deletions mathics_scanner/data/operators.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Autogenerated from operator_csv_to_yaml.py on 2024-08-30 11:18:52.480021
# Autogenerated from operator_csv_to_yaml.py on 2024-08-30 13:14:29.557630
# Information about Wolfram Language named operators.

# This information comes from Robert L. Jacobson's Table of Wolfram
Expand Down Expand Up @@ -1103,22 +1103,22 @@ Derivative:
name: Derivative
actual-precedence: 770
Precedence-Function: 670
precedence: 604
precedence: None
WolframLanguageData: 19
WolframLanguageData-corrected: 19
UnicodeCharacters.tr:
UnicodeCharacters.tr: None
UnicodeCharacters-corrected.tr: 680
# N-tokens: {}
# L-tokens: {"''"}
# O-tokens: {}
# usage: {{"expr", "''"}}
# parse: {"Derivative", "[", "n", "]", "[", "expr", "]"}
FullForm: Derivative[n][expr]
# N-tokens: None
# L-tokens: None
# O-tokens: None
# usage: None
# parse: None
FullForm: None
arity: Unary
affix: Postfix
associativity: left
meaningful: true
# comments:
# comments: None

Diamond:
name: Diamond
Expand Down Expand Up @@ -2677,6 +2677,26 @@ Increment:
meaningful: true
# comments:

Information:
name: Information
actual-precedence: 670
precedence: 670
WolframLanguageData: None
WolframLanguageData-corrected: None
UnicodeCharacters.tr: None
UnicodeCharacters-corrected.tr: None
# N-tokens: None
# L-tokens: None
# O-tokens: None
# usage: None
# parse: None
FullForm: None
arity: Binary
affix: Infix
associativity: null
meaningful: true
# comments: None

InlinePart:
name: InlinePart
actual-precedence: 900
Expand Down Expand Up @@ -2718,7 +2738,7 @@ Integrate:
meaningful: true
# comments:

InterpretBoxes:
InterpretationBox:
name: None
actual-precedence: 930
Precedence-Function: 670
Expand All @@ -2739,6 +2759,26 @@ InterpretBoxes:
meaningful: true
# comments:

InterpretedBox:
name: InterpretedBox
actual-precedence: 670
precedence: 670
WolframLanguageData: None
WolframLanguageData-corrected: None
UnicodeCharacters.tr: None
UnicodeCharacters-corrected.tr: None
# N-tokens: None
# L-tokens: None
# O-tokens: None
# usage: None
# parse: None
FullForm: None
arity: Binary
affix: Infix
associativity: null
meaningful: true
# comments: None

Intersection:
name: Intersection
actual-precedence: 390
Expand Down Expand Up @@ -5528,16 +5568,16 @@ PlusMinus:

Postfix:
name: Postfix
actual-precedence: 670
precedence: 670
actual-precedence: 640
precedence: 640
WolframLanguageData: None
WolframLanguageData-corrected: None
UnicodeCharacters.tr: None
UnicodeCharacters-corrected.tr: None
# N-tokens: None
# L-tokens: None
# O-tokens: None
# usage: None
# usage: expr // FormName
# parse: None
FullForm: None
arity: Binary
Expand Down Expand Up @@ -5697,7 +5737,7 @@ Prefix:
# N-tokens: None
# L-tokens: None
# O-tokens: None
# usage: None
# usage: expr1 @ expr2
# parse: None
FullForm: None
arity: Binary
Expand Down

0 comments on commit 7fc117f

Please sign in to comment.