Giter Site home page Giter Site logo

preparser issues about sage HOT 3 CLOSED

sagemath avatar sagemath commented on June 25, 2024
preparser issues

from sage.

Comments (3)

williamstein avatar williamstein commented on June 25, 2024

Description changed:

--- 
+++ 
@@ -1,4 +1,6 @@
-{{{To: "Kyle Schalm" <[email protected]>, [email protected]
+
+```
+To: "Kyle Schalm" <[email protected]>, [email protected]
 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
@@ -6,14 +8,12 @@
 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"
 """
+---------------------
+```
 
----
-}}}
-

from sage.

williamstein avatar williamstein commented on June 25, 2024
comment:2

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.

from sage.

williamstein avatar williamstein commented on June 25, 2024
comment:3

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

# HG changeset patch
# User William Stein <[email protected]>
# 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):

from sage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.