#11542: Fix preparse_file to prevent constants from being assigned to
------------------------------+---------------------------------------------
   Reporter:  nbruin          |          Owner:  was       
       Type:  defect          |         Status:  new       
   Priority:  major           |      Milestone:  sage-4.7.2
  Component:  user interface  |       Keywords:            
Work_issues:                  |       Upstream:  N/A       
   Reviewer:                  |         Author:            
     Merged:                  |   Dependencies:            
------------------------------+---------------------------------------------
 In this [https://groups.google.com/group/sage-
 devel/browse_thread/thread/97757e7b9f0d3f5b?hl=en sage-devel thread] Tom
 Boothby observed that misc.preparse_file has a habit to replace integers
 by identifiers that are supposed to be constants. This transformation
 turns some ungrammatical strings into grammatical ones, such as
 {{{
 1=5
 }}}
 which gets preparsed to
 {{{
 _sage_const_1 = Integer(1)
 _sage_const_5 = Integer(5)
 _sage_const_1 =_sage_const_5
 }}}
 Note that there does not have to be a "=" involved for this to happen:
 {{{
 [1^2 for j in range(10) for 1 in [1..2*1] ]
 }}}
 which only differs one keyword from the perfectly legal
 {{{
 [1^2 for j in range(10) if 1 in [1..2*1] ]
 }}}
 so it's likely that one has to fully parse the string to detect the
 problems.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11542>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to