Skip to content

Commit

Permalink
Merge pull request #758 from Mathics3/moving_messages_section
Browse files Browse the repository at this point in the history
Moving builtins to message
  • Loading branch information
rocky authored Jan 21, 2023
2 parents c7e3763 + 6b94c4d commit 93101e2
Show file tree
Hide file tree
Showing 3 changed files with 331 additions and 331 deletions.
14 changes: 0 additions & 14 deletions mathics/builtin/lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,20 +268,6 @@ def eval(self, expr, positions, evaluation):
return newexpr


class Failure(Builtin):
"""
<url>:WMA link:https://reference.wolfram.com/language/ref/Failure.html</url>
<dl>
<dt>Failure[$tag$, $assoc$]
<dd> represents a failure of a type indicated by $tag$, with details \
given by the association $assoc$.
</dl>
"""

summary_text = "a failure at the level of the interpreter"


# TODO: seems to want to produces a fancy box for failure.
# rules = {'Failure /: MakeBoxes[Failure[tag_, assoc_Association], StandardForm]' :
# 'With[{msg = assoc["MessageTemplate"], msgParam = assoc["MessageParameters"], type = assoc["Type"]}, ToBoxes @ Interpretation["Failure" @ Panel @ Grid[{{Style["\[WarningSign]", "Message", FontSize -> 35], Style["Message:", FontColor->GrayLevel[0.5]], ToString[StringForm[msg, Sequence @@ msgParam], StandardForm]}, {SpanFromAbove, Style["Tag:", FontColor->GrayLevel[0.5]], ToString[tag, StandardForm]},{SpanFromAbove,Style["Type:", FontColor->GrayLevel[0.5]],ToString[type, StandardForm]}},Alignment -> {Left, Top}], Failure[tag, assoc]] /; msg =!= Missing["KeyAbsent", "MessageTemplate"] && msgParam =!= Missing["KeyAbsent", "MessageParameters"] && msgParam =!= Missing["KeyAbsent", "Type"]]',
Expand Down
Loading

0 comments on commit 93101e2

Please sign in to comment.