Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#40 closed defect (wontfix)

preparser issues

Reported by: William Stein Owned by: somebody
Priority: major Milestone:
Component: user interface Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by William Stein)

To: "Kyle Schalm" <kschalm@math.utexas.edu>, sage-devel@lists.sourceforge.net
Subject: Re: [SAGEdev] long string parsing bug in 1.3.2.2

The SAGE pre-parser currently works on single lines only -- it doesn't
take into account multi-line blocks.  This is more a
not-implemented-error than a bug.  Many thanks for sending this email
though, since it's an excellent test case:
mm.sage:
---------------------
"""
load with
 
sage: load "/Users/kyle/Documents/math/scripts/mm.sage"
"""
---------------------

Change History (3)

comment:1 Changed 16 years ago by William Stein

Description: modified (diff)

comment:2 Changed 16 years ago by William Stein

Resolution: wontfix
Status: newclosed

I can't find this mm.sage example any more. Moreover, the preparser does work on multiple lines, so won't fix until get a proper bug report.

comment:3 Changed 16 years ago by William Stein

Component: basic arithmeticuser interface

I found that loading files with triple quoted multiline strings would break. Now fixed:

# HG changeset patch
# User William Stein <wstein@gmail.com>
# Date 1169354692 28800
# Node ID 9b38891949ca0db4e3df5592611a741f8b58568d
# Parent  19cc21de721be8ea5985cf1319582e1ab7dc2820
Finally fixed multiline preparser issue for command line.

diff -r 19cc21de721b -r 9b38891949ca sage/misc/interpreter.py
--- a/sage/misc/interpreter.py  Fri Jan 19 22:49:10 2007 -0800
+++ b/sage/misc/interpreter.py  Sat Jan 20 20:44:52 2007 -0800
@@ -248,7 +248,7 @@ def do_prefilter_paste(line, continuatio
                     ipmagic(L)
                 L = ''
             else:
-                L = preparser_ipython.preparse_ipython(L)
+                L = preparser_ipython.preparse_ipython(L, not continuation)
             __IPYTHON__.input_hist.append(L)
             __IPYTHON__.push(L)
         log.offset += 1
@@ -343,7 +343,7 @@ def do_prefilter_paste(line, continuatio
         else:
             raise ImportError, "Attaching of '%s' not implemented (load .py, .spyx, and .sage files)"%name
     if len(line) > 0:
-        line = preparser_ipython.preparse_ipython(line)
+        line = preparser_ipython.preparse_ipython(line, not continuation)
     return line
 
 def load_sagex(name):
Note: See TracTickets for help on using tickets.