Mathics3 / mathics-core

An open-source Mathematica. This repository contains the Python modules for WL Built-in functions, variables, core primitives, e.g. Symbol, a parser to create Expressions, and an evaluator to execute them.
https://mathics.org
Other
763 stars 44 forks source link

Parsing hexadecimal characters #906

Open mmatera opened 1 year ago

mmatera commented 1 year ago

In the task of migrating from private doctests to pytests, I hit the following bug when characters are written as escaped hexadecimal characters:

In[1]:= \.78\.79\.7A
Out[1]= xyz

but In[2]:= F[.78.79.7A] Syntax::sntxf: "xyz" cannot be followed by "]" (line 1 of ""). Out[2]=

and

In[3]:= ".78.79.7A"

Syntax::sntxf: "xyz" cannot be followed by "]" (line 1 of "").


However,

In[4]:= ".78.79.7A"" Out[4]= xyz

mmatera commented 1 year ago

Notice the comments in the test module introduced in #907