Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: when printing code, long literals are wrapped incorrectly #3205

Closed
fingolfin opened this issue Jan 21, 2019 · 1 comment
Closed
Labels
kind: bug Issues describing general bugs, and PRs fixing them topic: kernel

Comments

@fingolfin
Copy link
Member

Printing of function bodies with a long literals got broken somewhere between GAP 4.8 and GAP 4.9.

Using git bisect, I determined that this is caused by commit c78bb4c added by @stevelinton on 2017-08-17.

With GAP 4.8, we see this:

gap> SizeScreen([80,100]);;
gap> Display(f->2.12345678901234567890123456789012345678901234567890123456789012345678901234567890);
function ( f )
    return
     2.12345678901234567890123456789012345678901234567890123456789012345678901\
234567890;
end
gap> Display(f->212345678901234567890123456789012345678901234567890123456789012345678901234567890);
function ( f )
    return
     2123456789012345678901234567890123456789012345678901234567890123456789012\
34567890;
end
gap> Display(f->"212345678901234567890123456789012345678901234567890123456789012345678901234567890");
function ( f )
    return
     "212345678901234567890123456789012345678901234567890123456789012345678901\
234567890";
end

With GAP 4.9 or master, we see this:

gap> SizeScreen([80,100]);;
gap> Display(f->2.12345678901234567890123456789012345678901234567890123456789012345678901234567890);
function ( f )
    return
     2.12345678901234567890123456789012345678901234567890123456789012345678901\
\
234567890;
end
gap> Display(f->212345678901234567890123456789012345678901234567890123456789012345678901234567890);
function ( f )
    return
     2123456789012345678901234567890123456789012345678901234567890123456789012\
\
34567890;
end
function ( f )
    return
     "212345678901234567890123456789012345678901234567890123456789012345678901\
\
234567890";
end

My guess is that this can be fixed by also adding a Display method to complement the DisplayString method.

@fingolfin fingolfin added kind: bug Issues describing general bugs, and PRs fixing them topic: kernel labels Jan 21, 2019
fingolfin added a commit to fingolfin/gap that referenced this issue Jan 21, 2019
This fixes a problem where printing functions with long literals would
wrap those literals badly. As an example, before this fix, we got:

    gap> SizeScreen([60,100]);;
    gap> Display(f->12345678901234567890123456789012345678901234567890123456789012345678901234567890);
    function ( f )
        return
         12345678901234567890123456789012345678901234567890123\
    \
    456789012345678901234567890;
    end

With this fix, we get:

    gap> SizeScreen([60,100]);;
    gap> Display(f->12345678901234567890123456789012345678901234567890123456789012345678901234567890);
    function ( f )
        return
         12345678901234567890123456789012345678901234567890123\
    456789012345678901234567890;
    end

Fixes gap-system#3205
@fingolfin
Copy link
Member Author

That simple fix seems to work... I'll make a PR

fingolfin added a commit to fingolfin/gap that referenced this issue Jan 22, 2019
This fixes a problem where printing functions with long literals would
wrap those literals badly. As an example, before this fix, we got:

    gap> SizeScreen([60,100]);;
    gap> Display(f->12345678901234567890123456789012345678901234567890123456789012345678901234567890);
    function ( f )
        return
         12345678901234567890123456789012345678901234567890123\
    \
    456789012345678901234567890;
    end

With this fix, we get:

    gap> SizeScreen([60,100]);;
    gap> Display(f->12345678901234567890123456789012345678901234567890123456789012345678901234567890);
    function ( f )
        return
         12345678901234567890123456789012345678901234567890123\
    456789012345678901234567890;
    end

Fixes gap-system#3205
ssiccha pushed a commit to ssiccha/gap that referenced this issue Mar 27, 2019
This fixes a problem where printing functions with long literals would
wrap those literals badly. As an example, before this fix, we got:

    gap> SizeScreen([60,100]);;
    gap> Display(f->12345678901234567890123456789012345678901234567890123456789012345678901234567890);
    function ( f )
        return
         12345678901234567890123456789012345678901234567890123\
    \
    456789012345678901234567890;
    end

With this fix, we get:

    gap> SizeScreen([60,100]);;
    gap> Display(f->12345678901234567890123456789012345678901234567890123456789012345678901234567890);
    function ( f )
        return
         12345678901234567890123456789012345678901234567890123\
    456789012345678901234567890;
    end

Fixes gap-system#3205
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Issues describing general bugs, and PRs fixing them topic: kernel
Projects
None yet
Development

No branches or pull requests

1 participant