Skip to content

Commit

Permalink
Merge branch 'master' into lg/gcov
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens authored Sep 6, 2024
2 parents d90e754 + e82078d commit faba40b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pkg/JuliaInterface/gap/helpstring.g
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ BindGlobal( "HELP_Info", function( str, onlyexact )
elif Length(str) > 0 and str[1] = '?' then
str := str{[2..Length(str)]};
NormalizeWhitespace(str);
match:= HELP_DESC_MATCHES( books, str, false, onlyexact );
match:= HELP_DESC_MATCHES( books, str, false, onlyexact : HELP_TOPIC:= origstr );
if match[1] = true then
add( books, str );
fi;
Expand All @@ -538,7 +538,7 @@ fi;

# search for this topic
else
match:= HELP_DESC_MATCHES( books, str, true, onlyexact );
match:= HELP_DESC_MATCHES( books, str, true, onlyexact : HELP_TOPIC:= origstr );
if match[1] = true then
add( books, str );
if IsRecord( match[2] ) then
Expand Down
5 changes: 2 additions & 3 deletions pkg/JuliaInterface/gap/juliahelp.g
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,8 @@ HELP_BOOK_HANDLER.juliahelpformat:= rec(
# Give up.
return [ [], [] ];
fi;

res:= JuliaToGAP( IsString,
Julia.GAP.julia_help_string( module.( func ) ) );
func:= Julia.GAP.UnwrapJuliaFunc( module.( func ) );
res:= JuliaToGAP( IsString, Julia.GAP.julia_help_string( func ) );

# Store the information such that `HelpData` will find it.
HELP_BOOKS_INFO.julia.entries:= [ [ orig_topic, res ] ];
Expand Down
15 changes: 14 additions & 1 deletion pkg/JuliaInterface/tst/help.tst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#@local HelpTestFunction
#@local HelpTestFunction, str
gap> START_TEST( "help.tst" );

#
Expand Down Expand Up @@ -51,5 +51,18 @@ true
gap> HelpTestFunction( "something for which no match is found" );
true

# help for documented Julia functions
gap> HelpString( "Julia:wrap_rng" ) = "Help: no matching entry found";
true
gap> str:= HelpString( "Julia:GAP.wrap_rng" );; # is not exported from GAP
gap> PositionSublist( str, "wrap_rng" ) <> fail;
true
gap> str:= HelpString( "Julia:GapObj" );; # is exported from GAP
gap> PositionSublist( str, "GapObj" ) <> fail;
true
gap> str:= HelpString( "Julia:sqrt" );; # is from Julia.Base
gap> PositionSublist( str, "sqrt" ) <> fail;
true

#
gap> STOP_TEST( "help.tst" );

0 comments on commit faba40b

Please sign in to comment.