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

Sort error message strings and add stresc #1218

Merged
merged 1 commit into from
Dec 17, 2024
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
17 changes: 9 additions & 8 deletions mathics/builtin/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,16 +582,17 @@ class Syntax(Builtin):

# Extension: WMA does not provide lineno and filename in its error messages
messages = {
"snthex": r"4 hexadecimal digits are required after \: to construct a 16-bit character (line `4` of `5`).",
"sntoct1": r"3 octal digits are required after \ to construct an 8-bit character (line `4` of `5`).",
"sntoct2": r"2 hexadecimal digits are required after \. to construct an 8-bit character (line `4` of `5`).",
"sntxi": "Incomplete expression; more input is needed (line `4` of `5`).",
"sntxb": "Expression cannot begin with `1` (line `4` of `5`).",
"sntxf": "`1` cannot be followed by `2` (line `4` of `5`).",
"bktwrn": "`1` represents multiplication; use `2` to represent a function (line `4` of `5`).", # TODO
"bktmch": "`1` must be followed by `2`, not `3` (line `4` of `5`).",
"bktwrn": "`1` represents multiplication; use `2` to represent a function (line `4` of `5`).", # TODO
"com": "Warning: comma encountered with no adjacent expression. The expression will be treated as Null (line `4` of `5`).",
"snthex": r"4 hexadecimal digits are required after \: to construct a 16-bit character (line `4` of `5`).",
"sntoct1": r"3 octal digits are required after \ to construct an 8-bit character.",
"sntoct2": r"2 hexadecimal digits are required after \. to construct an 8-bit character.",
"sntue": "Unexpected end of file; probably unfinished expression (line `4` of `5`).",
"sntufn": "Unknown unicode longname `1` (line `4` of `5`).",
"com": "Warning: comma encountered with no adjacent expression. The expression will be treated as Null (line `4` of `5`).",
"sntxb": "Expression cannot begin with `1` (line `4` of `5`).",
"sntxf": "`1` cannot be followed by `2` (line `4` of `5`).",
"sntxi": "Incomplete expression; more input is needed (line `4` of `5`).",
"stresc": "Unknown string escape `1`",
}
summary_text = "syntax messages"
3 changes: 1 addition & 2 deletions mathics/core/evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,7 @@ def get_quiet_messages(self):

def message(self, symbol_name: str, tag, *msgs) -> Optional["Message"]:
"""
Format message given its components, ``symbol``, ``tag``

Format message given its components, ``symbol_name``, ``tag``

"""
from mathics.core.expression import Expression
Expand Down
Loading