#5079: [with patch, positive review] overly greedy RealNumber handling in
preparser
------------------------+---------------------------------------------------
Reporter: boothby | Owner: boothby
Type: defect | Status: new
Priority: major | Milestone: sage-3.3
Component: interfaces | Resolution:
Keywords: |
------------------------+---------------------------------------------------
Changes (by boothby):
* summary: [with patch, needs work] overly greedy RealNumber handling in
preparser => [with patch, positive review]
overly greedy RealNumber handling in preparser
Comment:
The above was caused by the notebook calling strip_string_literals and not
properly handling the returns. Accept the following as proof that
everything in sage is calling it right:
{{{
sage: search_src('strip_string_literals')
misc/preparser.py: -- Robert Bradshaw (2007-09-19): *
strip_string_literals, containing_block
misc/preparser.py:def strip_string_literals(code, state=None):
misc/preparser.py: sage: from sage.misc.preparser import
strip_string_literals
misc/preparser.py: sage: s, literals, state =
strip_string_literals(r'''['a', "b", 'c', "d\""]''')
misc/preparser.py: sage: print
strip_string_literals(r'-"\\\""-"\\"-')[0]
misc/preparser.py: sage: s, literals, state =
strip_string_literals("[a, '''b''', c, '']")
misc/preparser.py: sage: s, literals, state =
strip_string_literals("code '#' # ccc 't'"); s
misc/preparser.py: sage: s, literals, state =
strip_string_literals('s = "some'); s
misc/preparser.py: sage: s, literals, state =
strip_string_literals('thing" * 5', state); s
misc/preparser.py: L, literals, quote_state =
strip_string_literals(line, quote_state)
misc/preparser.py: contents, literals, state =
strip_string_literals(contents)
misc/preparser.py: code, literals, state = strip_string_literals(code)
server/notebook/cell.py:from sage.misc.preparser import
strip_string_literals
server/notebook/cell.py: s =
strip_string_literals(self.input_text())[0]
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5079#comment:5>
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
-~----------~----~----~----~------~----~------~--~---