#5442: preparser or magma.eval bug?
----------------------------+-----------------------------------------------
 Reporter:  kohel           |       Owner:  was
     Type:  defect          |      Status:  new
 Priority:  minor           |   Milestone:     
Component:  user interface  |    Keywords:     
----------------------------+-----------------------------------------------
 This works:

 sage: s = """
 x := [
     1,
     2,
     3 ];
 x;
 """
 sage: magma.eval(s)

 However, if one try to type the above interactively
 in the %magma shell, it crashes on the the first line
 'x := ['.

 The problem is that either preparse_ipython or
 magma.eval is too naive, inserting a ';' rather
 than waiting for the completion of the expression.

 As a start, I think the block:

 if interface_name in ['gap', 'magma', 'kash', 'singular']:
     if not line.endswith(';'):
         line += ';'

 should be deleted, but I don't know the Expect
 interface well-enough to suggest a complete fix.

 Remark: The magma.eval function handles for .. do,
 but not if the logical is split over more than one
 line, so maybe this function can be easily fixed
 to not insert a ';' when an expression is incomplete
 (e.g. '".."', 'for .. do', '[ .. ]', etc.).

 Subtleties arise when a opening to an expression is
 contained in a string.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5442>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel

--~--~---------~--~----~------------~-------~--~----~
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