Opened 3 years ago

Last modified 7 weeks ago

#24971 new defect

"0 = x" is preparsed very badly

Reported by: kcrisman Owned by:
Priority: major Milestone: sage-8.2
Component: user interface Keywords: preparser
Cc: slelievre Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by jdemeyer)

sage: preparse("0 = x")
'__tmp__=var("0"); Integer = symbolic_expression(x).function(0)'

This is because 0 = x becomes Integer(0) = x which is interpreted as defining a function Integer in the variable 0.

Observed in this ask.sagemath question.

Change History (4)

comment:1 Changed 3 years ago by kcrisman

  • Description modified (diff)

comment:2 Changed 3 years ago by jdemeyer

This must happen because of double preparsing:

0 = p

becomes

Integer(0) = p

which is interpreted as a function definition of the function Integer in the variable 0.

comment:3 Changed 3 years ago by jdemeyer

  • Component changed from PLEASE CHANGE to user interface
  • Description modified (diff)
  • Priority changed from critical to major
  • Summary changed from Very subtle preparser error in functions only to "0 = x" is preparsed very badly

comment:4 Changed 7 weeks ago by slelievre

  • Cc slelievre added
  • Keywords preparser added
Note: See TracTickets for help on using tickets.