Opened 14 years ago
Closed 14 years ago
#3752 closed defect (fixed)
[with patch, positive review] gap.eval -- oddity in parsing multiline input and comments
Reported by: | was | Owned by: | mhansen |
---|---|---|---|
Priority: | major | Milestone: | sage-3.3 |
Component: | interfaces | Keywords: | |
Cc: | Merged in: | ||
Authors: | Reviewers: | ||
Report Upstream: | Work issues: | ||
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
On Thu, Jul 31, 2008 at 11:20 AM, Peter <> wrote: > > Hi, > > I'm trying to use some GAP code in the Sage notebook, and the code has > many one-line comments in it (starting with #). I switched the > notebook to gap mode (using the dropdown menu) and then noticed that > in each cell only commands that appear before the first comment are > processed by GAP. The same happens in cells that start with %gap. > > Can someone perhaps verify this behaviour and/or suggest a fix? (I'm > using Sage 3.0.5, and the same behaviour seems to occur on > Sagenb.org.) Yes, here's an example of this in the sage notebook text form (I made the triple {'s into double for this ticket): {{{ Untitled system:gap {{id=112| Print(2 + 2); # add numbers Print(3 + 3); # add more numbers /// 4 }} }}}
Attachments (1)
Change History (5)
comment:1 Changed 14 years ago by
Changed 14 years ago by
comment:2 Changed 14 years ago by
- Owner changed from was to mhansen
- Status changed from new to assigned
- Summary changed from gap.eval -- oddity in parsing multiline input and comments to [with patch, needs review] gap.eval -- oddity in parsing multiline input and comments
comment:3 Changed 14 years ago by
- Summary changed from [with patch, needs review] gap.eval -- oddity in parsing multiline input and comments to [with patch, positive review] gap.eval -- oddity in parsing multiline input and comments
I have a performance concern, but this is #5086 now.
comment:4 Changed 14 years ago by
- Milestone changed from sage-3.4.1 to sage-3.3
- Resolution set to fixed
- Status changed from assigned to closed
Merged in Sage 3.3.alpha2
Cheers,
Michael
Note: See
TracTickets for help on using
tickets.
This problem can be fixed by adding the following lines at the start of the eval method in the file interfaces/gap.py:
(This still needs to be tested on a variety of GAP input lines.)
I also noticed that if the length of the string processed by GAP is more than ~103 characters, then no output is produced (although the GAP code seems to be evaluated correctly and any functions defined in the code works in subsequent notebook cells).
Here is an example: