Skip to content

Commit

Permalink
Add list of box operators and operator-to-string
Browse files Browse the repository at this point in the history
These can be used in the scanner and parser
  • Loading branch information
rocky committed Dec 8, 2024
1 parent 8996580 commit 7f8d8ec
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 173 deletions.
1 change: 0 additions & 1 deletion mathics_scanner/data/named-characters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
# 5. Unicode symbols cannot be overloaded, i.e. should not be used for more than one underlying function.
# For example, ≫ (U+226B, "Much Greater-Than") is already used for GreaterGreater and therefore should not be an alias for >> for Put.
# Likewise, ≪ (U+226A, "Much Less-Than") for Get, ∷ (U+2237, "Proportion") for MessageName, etc.

#
# Field definitions
# =================
Expand Down
121 changes: 0 additions & 121 deletions mathics_scanner/data/operators-additional.yml

This file was deleted.

104 changes: 53 additions & 51 deletions mathics_scanner/data/operators.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,19 @@
# "non-associative-operators", "unknown" under the key "miscellaneous-operators",
# and None as "flat_binary_operators.
#
# box-operator
# ------------
#
# This field exists and is set true if the operator is used in boxing. Boxing
# operators are enclosed in \( \) pairs.
#
# operator
# --------
#
# This field exists for box-operators. In the future, we may expand to other operators.
# (Non box operators are listed in fields of named-characters.)
# It is the string vlaue for the operator.

# meaningful
# ---------
# This field "true" if WMA defines a meaning for the operator and "false" if not.
Expand Down Expand Up @@ -1911,13 +1924,12 @@ FormBox:
WolframLanguageData-corrected: 78
UnicodeCharacters.tr:
UnicodeCharacters-corrected.tr: 160
# N-tokens: {}
# L-tokens: {"\\`"}
# O-tokens: {}
usage: "expr1 \\ expr2"
operator: "\\`"
usage: ["\\(`input\\)", "\\(form\\`input\\)"]
arity: Binary
affix: Infix
associativity: "unknown"
box-operator: true
meaningful: true
# comments:

Expand All @@ -1928,13 +1940,12 @@ FractionBox:
WolframLanguageData-corrected: 31
UnicodeCharacters.tr:
UnicodeCharacters-corrected.tr: 590
# N-tokens: {}
# L-tokens: {"\/"}
# O-tokens: {}
usage: "\\( expr1 \/ expr2 \\)"
operator: "\/"
usage: "\\(x\/y\\)"
arity: Binary
affix: Infix
associativity: "unknown"
box-operator: true
meaningful: true
# comments:

Expand Down Expand Up @@ -2445,14 +2456,13 @@ InterpretedBox:
WolframLanguageData-corrected: None
UnicodeCharacters.tr: None
UnicodeCharacters-corrected.tr: None
# N-tokens: None
# L-tokens: None
# O-tokens: None
# usage: "None"
operator: "\\!"
# usage: "\\!\(...\)"
FullForm: None
arity: Binary
affix: Infix
arity: Unary
affix: Prefix
associativity: null
box-operator: true
meaningful: true
# comments: None

Expand Down Expand Up @@ -4511,13 +4521,12 @@ OverscriptBox:
WolframLanguageData-corrected: 7
UnicodeCharacters.tr:
UnicodeCharacters-corrected.tr: 790
# N-tokens: {}
# L-tokens: {"\&"}
# O-tokens: {}
# usage: "expr1 \& expr2"
operator: "\\&"
usage: "\\(x\\&y\\)"
arity: Binary
affix: Infix
associativity: "unknown"
box-operator: true
meaningful: true
# comments:

Expand All @@ -4528,12 +4537,11 @@ OverunderscriptBox:
WolframLanguageData-corrected: 7.5
UnicodeCharacters.tr:
UnicodeCharacters-corrected.tr: 785
# N-tokens: {}
# L-tokens: {"\&"}
# O-tokens: {"\%"}
# usage: "expr1", "\&", "expr2 \% expr3"
operator: ["\\+", "\\%"]
usage: "\\(x\\+y\\%z\\)"
arity: Ternary
affix: Infix
box-operator: true
associativity: "unknown"
meaningful: true
# comments:
Expand Down Expand Up @@ -5079,13 +5087,12 @@ RadicalBox:
WolframLanguageData-corrected: 22
UnicodeCharacters.tr:
UnicodeCharacters-corrected.tr: 640
# N-tokens: {"\@"}
# L-tokens: {}
# O-tokens: {"\%"}
# usage: "\@", "expr1 \% expr2"
operator: ["\\@", "\\%"]
usage: "\\(\\@x\\%n\\)"
FullForm:
arity: Binary
arity: Ternary
affix: Prefix
box-operator: true
associativity: right
meaningful: true
# comments:
Expand Down Expand Up @@ -5868,14 +5875,13 @@ SqrtBox:
WolframLanguageData-corrected: 22
UnicodeCharacters.tr: 650
UnicodeCharacters-corrected.tr: 640
# N-tokens: {"\@"}
# L-tokens: {}
# O-tokens: {}
# usage: "{{"\@", "expr"}}"
operator: "\\@"
usage: "\\(\\@x\\)"
FullForm:
arity: Unary
affix: Prefix
associativity: "unknown"
box-operator: true
meaningful: true
# comments:

Expand Down Expand Up @@ -6274,20 +6280,19 @@ SuperDagger:
meaningful: true
# comments:

SuperscriptBox:
SubSuperscriptBox:
precedence: 590
WolframLanguageData: 21
WolframLanguageData-corrected: 21
UnicodeCharacters.tr:
UnicodeCharacters-corrected.tr: 660
# N-tokens: {}
# L-tokens: {"\^"}
# O-tokens: {}
# usage: "expr1 \^ expr2"
operator: ["\_", "\\%"]
usage: "\\(x\_y\\%z\\)"
FullForm:
arity: Binary
arity: Ternary
affix: Infix
associativity: "unknown"
box-operator: true
meaningful: true
# comments:

Expand Down Expand Up @@ -6325,21 +6330,20 @@ SupersetEqual:
meaningful: false
# comments:

SupersubscriptBox:
SupercriptBox:
Precedence-Function: 690
precedence: 590
WolframLanguageData: 21
WolframLanguageData-corrected: 21
UnicodeCharacters.tr:
UnicodeCharacters-corrected.tr: 660
# N-tokens: {}
# L-tokens: {"\^"}
# O-tokens: {"\%"}
# usage: "expr1", "\^", "expr2 \% expr3"
operator: "\\^"
usage: "\\(x\\^y\\)"
FullForm:
arity: Ternary
arity: Binary
affix: Infix
associativity: right
box-operator: true
meaningful: true
# comments:

Expand Down Expand Up @@ -6666,14 +6670,13 @@ UnderoverscriptBox:
WolframLanguageData-corrected: 7.5
UnicodeCharacters.tr:
UnicodeCharacters-corrected.tr: 785
# N-tokens: {}
# L-tokens: {"\+"}
# O-tokens: {"\%"}
# usage: "expr1", "\+", "expr2 \% expr3"
operator: ["\\+", "\\%"]
usage: "\\(x\\+y\\%z\\)"
FullForm:
arity: Ternary
affix: Infix
associativity: "unknown"
box-operator: true
meaningful: true
# comments:

Expand All @@ -6684,13 +6687,12 @@ UnderscriptBox:
WolframLanguageData-corrected: 7
UnicodeCharacters.tr:
UnicodeCharacters-corrected.tr: 790
# N-tokens: {}
# L-tokens: {"\+"}
# O-tokens: {}
usage: "expr1 \\+ expr2"
operator: "\\+"
usage: "\\(x\\+y\\)"
FullForm:
arity: Binary
affix: Infix
box-operator: true
associativity: "unknown"
meaningful: true
# comments:
Expand Down
Loading

0 comments on commit 7f8d8ec

Please sign in to comment.