Skip to content

Commit

Permalink
Simplify YAML (#68)
Browse files Browse the repository at this point in the history
* Simplify YAML
* Cross check named-characters.yml vs. operators.yml
* Note relation and differences between operators and characters
* Convert "None" and "Non" to null
  • Loading branch information
rocky authored Aug 29, 2024
1 parent d627f29 commit 6573852
Show file tree
Hide file tree
Showing 6 changed files with 1,018 additions and 1,365 deletions.
6 changes: 3 additions & 3 deletions mathics_scanner/data/OperatorTable.csv
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ NumberBase,None,-10,670,760,,1,,-10,{},"{""^^""}",{},"{{""n"", ""^^"", ""digits"
NumberMagnitude,None,-10,670,760,,1,,-10,{},"{""*^""}",{},"{{""number"", ""*^"", ""magnitude""}}","{""number"", ""*^"", ""magnitude""}",number*^magnitude,Binary,Infix,Non,True,"Gives mantissa*base^magnitude, where base^^mantissa=number and magnitude is a decimal number expressed without ^^, `, or ``. Only allowed in a number literal, and only after any ` or ``."
NumberPrecisionPostfix,None,-10,670,760,,1,,-10,{},"{""`""}",{},"{{""number"", ""`""}}","{""number"", ""`""}",number`,Unary,Postfix,Left,True,"Specifies the precision of number to be $MachinePrecision. Any magnitude must come after `."""
NumberPrecision,None,-10,670,760,,1,,-10,{},"{""`""}",{},"{{""number"", ""`"", ""s""}}","{""number"", ""`"", ""s""}",number`s,Binary,Infix,Non,True,"Specifies the precision of number, where s is a positive decimal expressed without using ^^ or `. Any magnitude must come after `."""
NumberAccuracy,None,-10,670,760,,1,,-10,{},"{""``""}",{},"{{""number"", ""``"", ""s""}}","{""number"", ""``"", ""s""}",number``s,Binary,Infix,Non,True,"Specifies the accuracy (in number of digits to the right of decimal) of number, where s is a positive decimal expressed without using ^^ or `. A magnitude must come after ``."
RawBackquote,None,-10,670,760,,1,,-10,{},"{""``""}",{},"{{""number"", ""``"", ""s""}}","{""number"", ""``"", ""s""}",number``s,Binary,Infix,Non,True,"Specifies the accuracy (in number of digits to the right of decimal) of number, where s is a positive decimal expressed without using ^^ or `. A magnitude must come after ``."
ContextPathSeparator,None,-10,670,760,,1,,-10,{},"{""`""}",{},"{{""symb1"", ""`"", ""symb2""}}","{""symb1"", ""`"", ""symb2""}",symb1`symb2,,,Non,True,"Functions as a decimal point: either contextpath1 or contextpath2 may be empty, but not both at the same time."
MessageName,MessageName,1060,750,750,2,2,,850,{},"{""::""}",{},"{{""expr"", ""::"", ""string""}}","{""MessageName"", ""["", ""expr"", "","", """", ""string"", """", ""]""}","MessageName[expr, ""string""]",Binary,Infix,Non,True,
SlotNumber,Slot,1050,740,740,3,3,,840,"{""#""}",{},{},"{{""#"", ""n""}}","{""Slot"", ""["", ""n"", ""]""}",Slot[n],Unary,Prefix,Non,True,
Expand Down Expand Up @@ -74,7 +74,7 @@ RightComposition,RightComposition,850,624,650,13,13,,740,{},"{""/*""}",{},"{{""e
FunctionApplyPrefix,Prefix,840,640,640,,14,730,730,{},"{""@"", """"}",{},"{{""expr1"", ""@"", ""expr2""}, {""expr1"", """", ""expr2""}}","{""expr1"", ""["", ""expr2"", ""]""}",expr1[expr2],Binary,Infix,Right,True,Operator Notations includes usages with invisible unicode characters.
FunctionApplyInfix,Infix,830,630,630,,15,,720,{},"{""~""}",{},"{{""expr1"", ""~"", ""expr2"", ""~"", ""expr3""}}","{""expr2"", ""["", ""expr1"", "","", ""expr3"", ""]""}","expr2[expr1, expr3]",Ternary,Infix,Left,True,"Infix[f[x,y]] will display as x~f~y. Precedence identifies Infix with this operator, and Precedence[Infix]==30 which is almost correct."
Apply,Apply,820,620,626,16,16,,710,{},"{""@@""}",{},"{{""expr1"", ""@@"", ""expr2""}}","{""Apply"", ""["", ""expr1"", "","", ""expr2"", ""]""}","Apply[expr1, expr2]",Binary,Infix,Right,True,
ApplyFirstLevel,Apply,810,620,625,16,16,,710,{},"{""@@@""}",{},"{{""expr1"", ""@@@"", ""expr2""}}","{""Apply"", ""["", ""expr1"", "","", ""expr2"", ""{"", ""1"", ""}"", ""]""}","Apply[expr1, expr2, List[1]]",Binary,Infix,Right,True,
MapApply,MapApply,810,620,625,16,16,,710,{},"{""@@@""}",{},"{{""expr1"", ""@@@"", ""expr2""}}","{""Apply"", ""["", ""expr1"", "","", ""expr2"", ""{"", ""1"", ""}"", ""]""}","MapApply[expr1, expr2, List[1]]",Binary,Infix,Right,True,
Map,Map,800,620,620,16,16,,710,{},"{""/@""}",{},"{{""expr1"", ""/@"", ""expr2""}}","{""Map"", ""["", ""expr1"", "","", ""expr2"", ""]""}","Map[expr1, expr2]",Binary,Infix,Right,True,
MapAll,MapAll,800,620,620,16,16,,710,{},"{""//@""}",{},"{{""expr1"", ""//@"", ""expr2""}}","{""MapAll"", ""["", ""expr1"", "","", ""expr2"", ""]""}","MapAll[expr1, expr2]",Binary,Infix,Right,True,
Factorial,Factorial,790,610,610,17,17,,700,{},"{""!""}",{},"{{""expr"", ""!""}}","{""Factorial"", ""["", ""expr"", ""]""}",Factorial[expr],Unary,Postfix,Left,True,
Expand Down Expand Up @@ -400,4 +400,4 @@ PutAppend,PutAppend,40,30,30,76,76,,180,{},"{"">>>""}",{},"{{""expr"", "">>>"",
CompoundExpression,CompoundExpression,30,10,10,77,77,,170,{},"{"";""}",{},"{{""expr1"", "";"", ""expr2""}}","{""CompoundExpression"", ""["", ""expr1"", "","", ""expr2"", ""]""}","CompoundExpression[expr1, expr2]",Binary,Infix,None,True,
CompoundExpressionNull,CompoundExpression,30,10,10,77,77,,170,{},"{"";""}",{},"{{""expr1"", "";"", ""expr2"", "";""}}","{""CompoundExpression"", ""["", ""expr1"", "","", ""expr2"", ""]""}","CompoundExpression[expr1, expr2, Null]",Unary,Postfix,Left,True,
FormBox,FormBox,20,670,5,78,78,,160,{},"{""\\`""}",{},"{{""expr1"", ""\\`"", ""expr2""}}","{""FormBox"", ""["", ""expr2"", "","", ""expr1"", ""]""}",,Binary,Infix,"Missing[""Unknown""]",True,
ImplicitSequence,Comma,10,670,755,,79,1,1,{},"{"""", "",""}",{},"{{""expr1"", """", ""expr2""}, {""expr1"", "","", ""expr2""}}","{""AngleBracket"", ""["", ""expr"", "","", ""…"", ""]""}","expr1, expr2",Binary,Infix,None,True,Operator Notations includes usages with invisible unicode characters.
ImplicitSequence,Comma,10,670,755,,79,1,1,{},"{"""", "",""}",{},"{{""expr1"", """", ""expr2""}, {""expr1"", "","", ""expr2""}}","{""AngleBracket"", ""["", ""expr"", "","", ""…"", ""]""}","expr1, expr2",Binary,Infix,None,True,Operator Notations includes usages with invisible unicode characters.
Loading

0 comments on commit 6573852

Please sign in to comment.