" ) ,
write_line_with_tag_colors( Ext, Txt ):- !,
string_codes( Txt, Codes ),
write_codes_with_tag_colors( Ext, Codes ).
% write_line_with_tag_colors( _Ext, Txt ):- write( Txt ).
%----
write_codes_with_tag_colors( _Ext, [] ):-!.
write_codes_with_tag_colors( Ext, [ H | Codes ] ):- H == 40, !, string_codes( Zx, [ H ] ),
write( "
" ) , write_codes_with_tag_colors( Ext, Codes ).
write_codes_with_tag_colors( Ext, [ H | Codes ] ):- H == 41, !, string_codes( Zx, [ H ] ),
write( "
" ) , write_codes_with_tag_colors( Ext, Codes ).
write_codes_with_tag_colors( Ext, [ H | Codes ] ):- !, string_codes( Zx, [ H ] ), write( Zx ),
write_codes_with_tag_colors( Ext, Codes ).
% sub_string( Txt, Pos, Len, Aft, "(" ) ,
% sub_string( Txt, 0, Pos, _, Begin ), Y is Pos + Len,
% sub_string( Txt, Y, Aft, 0, Rest_string ), !,
% write( Begin ) ,
% write( "
" ) ,
% write_line_with_tag_colors( Ext, Rest_string ).
make_used_tag_bold( TxLine1, Zk , Cat2 ):-
string_lower( TxLine1, Txlow ) , string_lower( Zk, Zk_low ) ,
sub_string( Txlow , Sta, Le, Aft , Zk_low ),
concat( Zk, "", Zk2 ), concat( "
" , C2 ),
sub_string( TxLine1 , 0, Sta, _ , Begin ),
Y is Sta + Le,
sub_string( TxLine1 , Y, Aft, _ , Rest ),
string_concat( Begin, C2, Cat1 ),
string_concat( Cat1, Rest, Cat2 ), !.
% str_replace_tag( TxLine1 , Zk, C2, Txtline2 ), !.
make_used_tag_bold( Tx, _Zk , Tx ):- !.
% write_line_with_tag_colors( '', " ajjahsgdfgfgf ffhhfh fhfhfhh ffhhf", "ffhh" ).
% % string_length( Zk, Lx ), Lx > 0,
% write( "
" ) ,
write_line_with_tag_colors( Ext, Txt ):- !,
string_codes( Txt, Codes ),
write_codes_with_tag_colors( Ext, Codes ).
% write_line_with_tag_colors( _Ext, Txt ):- write( Txt ).
%----
search_prolog_files( Tp, _Dk, Zk, MdfKeyaft, Is_mk_update, Xfi , Isleading ):-
read_files_dir( 'prolog_source_dir', Sdir ), !,
retractall( chercher_a( _ ) ), assert( chercher_a( "eval_20&:-" ) ),
retractall( current_file_extension( _ ) ), assert( current_file_extension( '.pl' ) ),
retractall( singularity_src_dir_perform( _ ) ),
% assert( singularity_src_dir_perform( '../canary/' ) ),
assert( singularity_src_dir_perform( Sdir ) ),
singularity_src_dir_perform( Dirx_zz_00 ),
get_all_singularity_files( Tp, MdfKeyaft, Dirx_zz_00 ), sleep(2),
write(" start read files \n"), write("\n
 
\n"),
retractall( dir_level( _, _, _, _, _, _, _, _, _, _) ),
retractall( file_level(_, _, _, _, _, _, _, _, _, _, _) ),
retractall( found_include_file( _, _, _, _, _, _, _, _, _, _, _ )),
consult( Xfi ),
write( "Consulted\n" ), write( Xfi ), nl, write( "\n
 
\n" ),
read_all_singularity_files( is_octet, Tp, Zk, only_copy_files, Is_mk_update, 'dummy_001', 0 , Isleading ),
read_all_singularity_files( is_octet, Tp, Zk, only_copy_files, Is_mk_update, 'dummy_001', 1, Isleading ).
<<<<<<< HEAD
search_prolog_files( _Tp, _Dk, _Zk, _MdfKeyaft, _Is_mk_update, _Xfi , _Isleading ):- !.
=======
>>>>>>> d3628bb (Update analyse to a Table and after CSV)
%--
% assert( singularity_src_dir_perform( '../../tests/baseline_compat/' ) ),
% assert( singularity_src_dir_perform( '../../tests/' ) ),
search_metta_files( Tp, _Dk, Zk, MdfKeyaft, Is_mk_update, Xfi, Isleading ):-
read_files_dir( 'search_metta_files_dir', Sdir ), !,
retractall( chercher_a( _ ) ), assert( chercher_a( "assertEqual" ) ),
retractall( current_file_extension( _ ) ), assert( current_file_extension( '.metta' ) ),
retractall( singularity_src_dir_perform( _ ) ),
<<<<<<< HEAD
assert( singularity_src_dir_perform( Sdir ) ),
=======
% assert( singularity_src_dir_perform( '../../tests/baseline_compat/hyperon-mettalog_sanity/' ) ),
assert( singularity_src_dir_perform( '../../tests/baseline_compat/' ) ),
>>>>>>> d3628bb (Update analyse to a Table and after CSV)
singularity_src_dir_perform( Dirx_zz_2 ), get_all_singularity_files( Tp, MdfKeyaft, Dirx_zz_2 ), sleep(2),
write(" start read files \n"), write("\n
 
\n"),
retractall( dir_level( _, _, _, _, _, _, _, _, _, _) ), retractall( file_level(_, _, _, _, _, _, _, _, _, _, _) ),
consult( Xfi ),
write( "Consulted\n" ), write( Xfi ), nl, write( "\n
 
\n" ),
read_all_singularity_files( is_octet, Tp, Zk, only_copy_files, Is_mk_update, Dirx_zz_2, 0 , Isleading),
read_all_singularity_files( is_octet, Tp, Zk, only_copy_files, Is_mk_update, Dirx_zz_2, 1 , Isleading).
<<<<<<< HEAD
search_metta_files( _Tp, _Dk, _Zk, _MdfKeyaft, _Is_mk_update, _Xfi, _Isleading ):- !.
search_metta_files_else_where( Tp, _Dk, Zk, MdfKeyaft, Is_mk_update, Xfi, _Isleading ):-
read_files_dir( 'search_metta_files_else_where_dir', Sdir ), !,
retractall( chercher_a( _ ) ), assert( chercher_a( "assertEqual" ) ),
retractall( current_file_extension( _ ) ), assert( current_file_extension( '.metta' ) ),
retractall( singularity_src_dir_perform( _ ) ),
assert( singularity_src_dir_perform( Sdir ) ),
singularity_src_dir_perform( Dirx_zz_2 ), get_all_singularity_files( Tp, MdfKeyaft, Dirx_zz_2 ), sleep(2),
write(" start read files \n"), write("\n
 
\n"),
retractall( dir_level( _, _, _, _, _, _, _, _, _, _) ), retractall( file_level(_, _, _, _, _, _, _, _, _, _, _) ),
consult( Xfi ),
write( "Consulted\n" ), write( Xfi ), nl, write( "\n
 
\n" ),
read_all_singularity_files( is_octet, Tp, Zk, only_copy_files, Is_mk_update, Dirx_zz_2, 0 , metta_else_where ),
read_all_singularity_files( is_octet, Tp, Zk, only_copy_files, Is_mk_update, Dirx_zz_2, 1 , metta_else_where ).
search_metta_files_else_where( _Tp, _Dk, _Zk, _MdfKeyaft, _Is_mk_update, _Xfi, _Isleading ):- !.
search_metta_files_std_lib( Tp, _Dk, Zk, MdfKeyaft, Is_mk_update, Xfi, _Isleading ):-
read_files_dir( 'metta_std_lib_dir', Sdir ), !,
=======
search_metta_files_std_lib( Tp, _Dk, Zk, MdfKeyaft, Is_mk_update, Xfi, _Isleading ):-
>>>>>>> d3628bb (Update analyse to a Table and after CSV)
retractall( chercher_a( _ ) ), assert( chercher_a( "assertEqual" ) ),
retractall( current_file_extension( _ ) ), assert( current_file_extension( '.metta' ) ),
retractall( singularity_src_dir_perform( _ ) ),
% canary
% assert( singularity_src_dir_perform( '../../tests/extended_compat/metta-examples/' ) ),
<<<<<<< HEAD
% assert( singularity_src_dir_perform( '../canary/' ) ),
assert( singularity_src_dir_perform( Sdir ) ),
=======
assert( singularity_src_dir_perform( '../canary/' ) ),
>>>>>>> d3628bb (Update analyse to a Table and after CSV)
singularity_src_dir_perform( Dirx_zz_2 ), get_all_singularity_files( Tp, MdfKeyaft, Dirx_zz_2 ), sleep(2),
write(" start read files search_metta_files_std_lib \n"), write("\n
 
\n"),
retractall( dir_level( _, _, _, _, _, _, _, _, _, _) ), retractall( file_level(_, _, _, _, _, _, _, _, _, _, _) ),
consult( Xfi ),
write( "Consulted\n" ), write( Xfi ), nl, write( "\n
 
\n" ),
read_all_singularity_files( is_octet, Tp, Zk, only_copy_files, Is_mk_update, Dirx_zz_2, 0 , metta_std_lib ),
read_all_singularity_files( is_octet, Tp, Zk, only_copy_files, Is_mk_update, Dirx_zz_2, 1 , metta_std_lib ).
<<<<<<< HEAD
search_metta_files_std_lib( _Tp, _Dk, _Zk, _MdfKeyaft, _Is_mk_update, _Xfi, _Isleading ):- !.
=======
search_metta_files_else_where( Tp, _Dk, Zk, MdfKeyaft, Is_mk_update, Xfi, _Isleading ):-
retractall( chercher_a( _ ) ), assert( chercher_a( "assertEqual" ) ),
retractall( current_file_extension( _ ) ), assert( current_file_extension( '.metta' ) ),
retractall( singularity_src_dir_perform( _ ) ),
assert( singularity_src_dir_perform( '../../tests/extended_compat/metta-examples/' ) ),
singularity_src_dir_perform( Dirx_zz_2 ), get_all_singularity_files( Tp, MdfKeyaft, Dirx_zz_2 ), sleep(2),
write(" start read files \n"), write("\n
 
\n"),
retractall( dir_level( _, _, _, _, _, _, _, _, _, _) ), retractall( file_level(_, _, _, _, _, _, _, _, _, _, _) ),
consult( Xfi ),
write( "Consulted\n" ), write( Xfi ), nl, write( "\n
 
\n" ),
read_all_singularity_files( is_octet, Tp, Zk, only_copy_files, Is_mk_update, Dirx_zz_2, 0 , metta_else_where ),
read_all_singularity_files( is_octet, Tp, Zk, only_copy_files, Is_mk_update, Dirx_zz_2, 1 , metta_else_where ).
>>>>>>> d3628bb (Update analyse to a Table and after CSV)
% assert( singularity_src_dir_perform( '../../tests/extended_compat/' ) ),
% assert( singularity_src_dir_perform( '../../tests/features/' ) ),
% \\wsl.localhost\Ubuntu\home\drspro\metta-wam\tests\extended_compat\metta-examples
% assert( singularity_src_dir_perform( '../../tests/baseline_compat/hyperon-mettalog_sanity/' ) ),
% assert( singularity_src_dir_perform( '../../tests/baseline_compat/' ) ),
search_metta_files2( Tp, _Dk, Zk, MdfKeyaft, Is_mk_update, Xfi, Isleading ):-
<<<<<<< HEAD
read_files_dir( 'examples_source_dir', Sdir ), !,
retractall( chercher_a( _ ) ), assert( chercher_a( "assertEqual" ) ),
retractall( current_file_extension( _ ) ), assert( current_file_extension( '.metta' ) ),
retractall( singularity_src_dir_perform( _ ) ),
% assert( singularity_src_dir_perform( '../../../metta-examples-main/' ) ),
assert( singularity_src_dir_perform( Sdir ) ),
=======
retractall( chercher_a( _ ) ), assert( chercher_a( "assertEqual" ) ),
retractall( current_file_extension( _ ) ), assert( current_file_extension( '.metta' ) ),
retractall( singularity_src_dir_perform( _ ) ),
assert( singularity_src_dir_perform( '../../../metta-examples-main/' ) ),
>>>>>>> d3628bb (Update analyse to a Table and after CSV)
singularity_src_dir_perform( Dirx_zz_2 ), get_all_singularity_files( Tp, MdfKeyaft, Dirx_zz_2 ), sleep(2),
write(" start read files \n"), write("\n
 
\n"),
retractall( dir_level( _, _, _, _, _, _, _, _, _, _) ), retractall( file_level(_, _, _, _, _, _, _, _, _, _, _) ),
consult( Xfi ),
write( "Consulted\n" ), write( Xfi ), nl, write( "\n
 
\n" ),
read_all_singularity_files( is_octet, Tp, Zk, only_copy_files, Is_mk_update, Dirx_zz_2, 0 , Isleading),
read_all_singularity_files( is_octet, Tp, Zk, only_copy_files, Is_mk_update, Dirx_zz_2, 1 , Isleading).
<<<<<<< HEAD
search_metta_files2( _Tp, _Dk, _Zk, _MdfKeyaft, _Is_mk_update, _Xfi, _Isleading ):- !.
=======
>>>>>>> d3628bb (Update analyse to a Table and after CSV)
search_metta_files_hyperon( Tp, _Dk, Zk, MdfKeyaft, Is_mk_update, Xfi, Isleading ):-
read_files_dir( 'metta_python_source_dir', Sdir ), !,
retractall( chercher_a( _ ) ), assert( chercher_a( "assertEqual" ) ),
retractall( current_file_extension( _ ) ), assert( current_file_extension( '.metta' ) ),
retractall( singularity_src_dir_perform( _ ) ),
% assert( singularity_src_dir_perform( '../../../hyperon-experimental/python/' ) ),
assert( singularity_src_dir_perform( Sdir ) ),
singularity_src_dir_perform( Dirx_zz_3 ), get_all_singularity_files( Tp, MdfKeyaft, Dirx_zz_3 ), sleep(2),
write(" start read files \n"), write("\n
 
\n"),
retractall( dir_level( _, _, _, _, _, _, _, _, _, _) ), retractall( file_level(_, _, _, _, _, _, _, _, _, _, _) ),
consult( Xfi ),
write( "Consulted\n" ), write( Xfi ), nl, write( "\n
 
\n" ),
read_all_singularity_files( is_octet, Tp, Zk, only_copy_files, Is_mk_update, Dirx_zz_3, 0 , Isleading),
read_all_singularity_files( is_octet, Tp, Zk, only_copy_files, Is_mk_update, Dirx_zz_3, 1 , Isleading).
<<<<<<< HEAD
search_metta_files_hyperon( _Tp, _Dk, _Zk, _MdfKeyaft, _Is_mk_update, _Xfi, _Isleading ):- !.
=======
>>>>>>> d3628bb (Update analyse to a Table and after CSV)
search_python_files_hyperon( Tp, _Dk, Zk, MdfKeyaft, Is_mk_update, Xfi, Isleading ):-
read_files_dir( 'python_source_dir', Sdir ), !,
retractall( chercher_a( _ ) ), assert( chercher_a( "assertEqual" ) ),
retractall( current_file_extension( _ ) ), assert( current_file_extension( '.py' ) ),
retractall( singularity_src_dir_perform( _ ) ),
% assert( singularity_src_dir_perform( '../../../hyperon-experimental/python/' ) ),
assert( singularity_src_dir_perform( Sdir ) ),
singularity_src_dir_perform( Dirx_zz_4 ), get_all_singularity_files( Tp, MdfKeyaft, Dirx_zz_4 ), sleep(2),
write(" start read files \n"), write("\n
 
\n"),
retractall( dir_level( _, _, _, _, _, _, _, _, _, _) ), retractall( file_level(_, _, _, _, _, _, _, _, _, _, _) ),
consult( Xfi ),
write( "Consulted\n" ), write( Xfi ), nl, write( "\n
 
\n" ),
read_all_singularity_files( is_octet, Tp, Zk, only_copy_files, Is_mk_update, Dirx_zz_4, 0 , Isleading),
read_all_singularity_files( is_octet, Tp, Zk, only_copy_files, Is_mk_update, Dirx_zz_4, 1 , Isleading).
search_python_files_hyperon( _Tp, _Dk, _Zk, _MdfKeyaft, _Is_mk_update, _Xfi, _Isleading ):- !.
search_rust_files_hyperon( Tp, _Dk, Zk, MdfKeyaft, Is_mk_update, Xfi, Isleading ):-
read_files_dir( 'hyperon_source_dir', Sdir ), !,
retractall( chercher_a( _ ) ), assert( chercher_a( "assertEqual" ) ),
retractall( current_file_extension( _ ) ), assert( current_file_extension( '.rs' ) ),
<<<<<<< HEAD
retractall( singularity_src_dir_perform( _ ) ),
% assert( singularity_src_dir_perform( '../../../hyperon-experimental/lib/src/' ) ),
assert( singularity_src_dir_perform( Sdir ) ),
=======
retractall( singularity_src_dir_perform( _ ) ), assert( singularity_src_dir_perform( '../../../hyperon-experimental/lib/src/' ) ),
>>>>>>> d3628bb (Update analyse to a Table and after CSV)
singularity_src_dir_perform( Dirx_zz_5 ), get_all_singularity_files( Tp, MdfKeyaft, Dirx_zz_5 ), sleep(2),
write(" start read files \n"), write("\n
 
\n"),
retractall( dir_level( _, _, _, _, _, _, _, _, _, _) ), retractall( file_level(_, _, _, _, _, _, _, _, _, _, _) ),
consult( Xfi ),
write( "Consulted\n" ), write( Xfi ), nl, write( "\n
 
\n" ),
% read_all_singularity_files( is_octet, Tp, Zk, only_copy_files, Is_mk_update, Dirx_zz_5, 0 , Isleading),
% read_all_singularity_files( is_octet, Tp, Zk, only_copy_files, Is_mk_update, Dirx_zz_5, 1 , Isleading).
<<<<<<< HEAD
=======
>>>>>>> d3628bb (Update analyse to a Table and after CSV)
read_all_singularity_files( is_utf8, Tp, Zk, only_copy_files, Is_mk_update, Dirx_zz_5, 0 , Isleading),
read_all_singularity_files( is_utf8, Tp, Zk, only_copy_files, Is_mk_update, Dirx_zz_5, 1 , Isleading).
search_rust_files_hyperon( _Tp, _Dk, _Zk, _MdfKeyaft, _Is_mk_update, _Xfi, _Isleading ):- !.
%---
short_code_metta( include_metta_files, 'inc' ):-!.
short_code_metta( _Inc_Metta, 'notinc' ):-!.
%----
% CENTRAL ALL DIRS
read_files_dir( 'hyperon_source_dir', '../../../hyperon-experimental/lib/src/' ).
read_files_dir( 'prolog_source_dir', '../canary/' ).
read_files_dir( 'metta_std_lib_dir', '../canary/' ).
% the se 2 should not be the same or contain eachother
read_files_dir( 'search_metta_files_dir', '../../tests/' ).
read_files_dir( 'search_metta_files_else_where_dir', '../../tests/extended_compat/metta-examples/' ).
read_files_dir( 'examples_source_dir', '../../../metta-examples-main/' ).
read_files_dir( 'python_source_dir', '../../../hyperon-experimental/python/' ).
read_files_dir( 'metta_python_source_dir', '../../../hyperon-experimental/python/' ).
%---
also_search_metta_files( include_metta_files , Tp, Dk, Zk, MdfKeyaft, Is_mk_update, Xfi ):- !,
<<<<<<< HEAD
% TEMP
write( "Phase- metta STDLIB files" ), nl,
search_metta_files_std_lib( Tp, Dk, Zk, MdfKeyaft, Is_mk_update, Xfi, is_not_leading ),
% If these directorys are equal then only one of them should be performed
search_metta_files( Tp, Dk, Zk, MdfKeyaft, Is_mk_update, Xfi, is_not_leading ),
search_metta_files_else_where( Tp, Dk, Zk, MdfKeyaft, Is_mk_update, Xfi, is_not_leading ),
% TEMP
search_metta_files2( Tp, Dk, Zk, MdfKeyaft, Is_mk_update, Xfi, is_not_leading ),
=======
search_metta_files( Tp, Dk, Zk, MdfKeyaft, Is_mk_update, Xfi, is_not_leading ),
% TEMP
write( "Phase- metta STDLIB files" ), nl,
search_metta_files_std_lib( Tp, Dk, Zk, MdfKeyaft, Is_mk_update, Xfi, is_not_leading ),
% TEMP
search_metta_files2( Tp, Dk, Zk, MdfKeyaft, Is_mk_update, Xfi, is_not_leading ),
search_metta_files_else_where( Tp, Dk, Zk, MdfKeyaft, Is_mk_update, Xfi, is_not_leading ),
>>>>>>> d3628bb (Update analyse to a Table and after CSV)
!.
% search_metta_files_else_where( Tp, _Dk, Zk, MdfKeyaft, Is_mk_update, Xfi, _Isleading ),
% TEMP
% search_metta_files_hyperon( Tp, Dk, Zk, MdfKeyaft, Is_mk_update, Xfi, is_not_leading ), !.
also_search_metta_files( _, _,_,_, _,_,_ ):- !.
%--
% ( i
search_all_files_with_leading( 'prolog_leading', Tp, Dk, Zk, MdfKeyaft, Is_mk_update, Xfi , Inc_Metta ):- !,
search_prolog_files( Tp, Dk, Zk, MdfKeyaft, Is_mk_update, Xfi, is_leading ),
search_python_files_hyperon( Tp, Dk, Zk, MdfKeyaft, Is_mk_update, Xfi, is_not_leading ),
search_rust_files_hyperon( Tp, Dk, Zk, MdfKeyaft, Is_mk_update, Xfi, is_not_leading ),
also_search_metta_files( Inc_Metta, Tp, Dk, Zk, MdfKeyaft, Is_mk_update, Xfi ),
%search_metta_files( Tp, Dk, Zk, MdfKeyaft, Is_mk_update, Xfi, is_not_leading ),
%search_metta_files_hyperon( Tp, Dk, Zk, MdfKeyaft, Is_mk_update, Xfi, is_not_leading ),
!.
search_all_files_with_leading( 'python_leading', Tp, Dk, Zk, MdfKeyaft, Is_mk_update, Xfi , Inc_Metta ):- !,
search_python_files_hyperon( Tp, Dk, Zk, MdfKeyaft, Is_mk_update, Xfi, is_leading ),
search_prolog_files( Tp, Dk, Zk, MdfKeyaft, Is_mk_update, Xfi, is_not_leading ),
search_rust_files_hyperon( Tp, Dk, Zk, MdfKeyaft, Is_mk_update, Xfi, is_not_leading ),
also_search_metta_files( Inc_Metta, Tp, Dk, Zk, MdfKeyaft, Is_mk_update, Xfi ),
%search_metta_files( Tp, Dk, Zk, MdfKeyaft, Is_mk_update, Xfi, is_not_leading ),
%search_metta_files_hyperon( Tp, Dk, Zk, MdfKeyaft, Is_mk_update, Xfi, is_not_leading ),
!.
search_all_files_with_leading( 'rust_leading' , Tp, Dk, Zk, MdfKeyaft, Is_mk_update, Xfi , Inc_Metta ):- !,
%
write("Phase- python"), nl,
search_python_files_hyperon( Tp, Dk, Zk, MdfKeyaft, Is_mk_update, Xfi, is_leading ),
% write("Phase-1"), nl,
read_rustfile_tags( '../../../hyperon-experimental/lib/src/metta/runner/stdlib.rs' ),
search_rust_files_hyperon( Tp, Dk, Zk, MdfKeyaft, Is_mk_update, Xfi, is_not_leading ),
write("Phase-PROLOG"), nl,
search_prolog_files( Tp, Dk, Zk, MdfKeyaft, Is_mk_update, Xfi, is_not_leading ),
write("Phase-metta files"), nl,
also_search_metta_files( Inc_Metta, Tp, Dk, Zk, MdfKeyaft, Is_mk_update, Xfi ),
%*search_metta_files( Tp, Dk, Zk, MdfKeyaft, Is_mk_update, Xfi, is_not_leading ),
%*search_metta_files_hyperon( Tp, Dk, Zk, MdfKeyaft, Is_mk_update, Xfi, is_not_leading ),
!.
% search_metta_files( Tp, Dk, Zk, MdfKeyaft, Is_mk_update, Xfi, is_not_leading ),
% search_metta_files_hyperon( Tp, Dk, Zk, MdfKeyaft, Is_mk_update, Xfi, is_not_leading ),
reset_htm( _Display_per_file_or_per_tag, _LeadingTag, _Inc_Metta, Htmfile ):-
tell( Htmfile ),
<<<<<<< HEAD
get_time( TimeStamp ),
=======
get_time(TimeStamp),
>>>>>>> d3628bb (Update analyse to a Table and after CSV)
write("\n \n"),
write("\n \n"),
write("\n \n"),
write("\n \n"),
write("\n \n"),
write("
\n Time "), write( TimeStamp ), write("
\n"),
%write("
\n"), write( Inc_Metta ), write("
\n"),
%write("
\n"), write( Display_per_file_or_per_tag ), write("
\n"),
%write("
\n"), write( LeadingTag ), write("
\n"),
told().
%---
find_tags( Tag , Tg1 , Tg2 , Tg3 ):-
eval_tag_found( 'metta', Tag , Tg1 , Tg2 , Tg3 ,_) , !.
find_tags( _Tag , "cantf1", "cantf2", "cantf3" ):-!.
% eval_tag_found( 'metta', Tag , Tg1 , Tg2 , Tg3 ) ,
%display_tags_not_found():-
% eval_tag_found( Tag ), retract( eval_tag( Tag ) ), fail , !.
%display_tags_not_found():-
% write( "@DOC-tag not found - uncovered / created default
" ), nl,
% eval_tag( _, Tag, _ ),
% not( eval_tag_found( 'metta_doc', Tag, _ , _ , _ ) ),
% write( "
Default @doc code : " ) , write( Tag ), write( " " ), nl, fail, !.
tag_types( 'rust' ).
tag_types( 'python' ).
tag_types( 'metta_ontol_pl' ).
tag_types( 'metta_example' ).
tag_types( 'metta' ).
tag_types( '' ).
display_tags_not_found():-
write( "@METTA-example TAGS
" ), nl,
tag_types( Type ),
nl, write("
"), write( Type ) , nl,
% eval_tag( _, Tag, _ ),
% write( "
" ), nl,
% write( "
Default metta example : -" ) , write( Tag ), write( "- "),
eval_tag_found( Type , Tag , _ , _ , _ ,_) ,
% write(" not FOUND "),
nl, write("
"), write( Type ) , write( " " ), write( Tag ), nl,
fail, !.
% write( Tg1 ), write( " " ), write( Tg2 ), write( " " ), write( Tg3 ),
% find_tags( Tag , Tg1 , Tg2 , Tg3 ),
% eval_tag_found( 'metta', Tag , Tg1 , Tg2 , Tg3 ) ,
%display_tags_not_found():-
% write( "Tags not found - uncovered
" ), nl,
% eval_tag( _, Tag, _ ),
% not( eval_tag_found( _, Tag ) ),
% write( "
" ) , write( Tag ), write( " " ), nl, fail, !.
display_tags_not_found():- !.
%---
% i,o,o
get_tag_properties( Tag, "yes", "yes" ):- eval_tag( 'rust', _, Tag, _ , _ , _), eval_tag( 'pl_tag', _, Tag, _ , _ , _), !.
get_tag_properties( Tag, "yes", "" ):- eval_tag( 'rust', _, Tag, _ , _ , _), !.
get_tag_properties( Tag, "", "yes" ):- eval_tag( 'pl_tag', _, Tag, _ , _ , _), !.
get_tag_properties( _El, "", "" ):-!.
write_cell( Tag ):- write( "
" ), write( Tag ), write( " | " ), !.
<<<<<<< HEAD
write_cell_pre( Tag ):- write( "
" ), write( Tag ), write( " | " ), !.
=======
>>>>>>> d3628bb (Update analyse to a Table and after CSV)
write_head( Tag ):- write( "
" ), write( Tag ), write( " | " ), !.
%---
sequence_of_tags( Prolog_and_rust, Rustonly, Prologonly ):-
findall( Tag, eval_tag( 'rust', _, Tag, _ , _ , _), Taglis1 ),
findall( Tag2, eval_tag( 'pl_tag', _, Tag2, _ , _ , _), Taglis2 ),
intersection( Taglis1, Taglis2, Prolog_and_rust0 ), sort( Prolog_and_rust0, Prolog_and_rust ),
subtract( Taglis1, Taglis2, Rustonly0 ), sort( Rustonly0, Rustonly ),
subtract( Taglis2, Taglis1, Prologonly0 ), sort( Prologonly0, Prologonly ).
% append( Taglis1, Taglis2, Taglis3 ), sort( Taglis3, Taglis4 ),
% member( El, Taglis4 ),
% found_search_result(metta_example,
% "match",1,3,'../
% eval_tag(metta_tag_std_lib,1348,"format-args",'../canary/stdlib_me
% eval_tag(metta_example,58,"let*",'../../tests/baseline_compat/hyp
:- dynamic tag_for_table/1.
set_tags_for_table():- retractall( tag_for_table( _ ) ),
sequence_of_tags( Prolog_and_rust, Rustonly, Prologonly ),
append( Prolog_and_rust, Rustonly, C1 ), append( C1, Prologonly, Taglis4 ),
member( El_tag, Taglis4 ), assert( tag_for_table( El_tag ) ), fail, !.
set_tags_for_table():- !.
find_has_metta_doc( El_tag , "has @doc" ):- eval_tag( metta_tag_std_lib, _, El_tag , _F, _Str, _ ),!.
<<<<<<< HEAD
find_has_metta_doc( _El_tag , "
NO @doc" ):- !.
find_has_metta_type_doc( El_tag , "has type @doc" , Str ):- eval_tag( metta_tag_std_lib, _, El_tag , _F, Str, _ ),
sub_string( Str, _ , _ , _ , "(: "), ! .
find_has_metta_type_doc( _El_tag , "
No type @doc" , "
No type @doc" ):- !.
% metta_function_declaration
=======
find_has_metta_doc( _El_tag , "
no @doc" ):- !.
>>>>>>> d3628bb (Update analyse to a Table and after CSV)
% is_metta
%---
% 'rust'
<<<<<<< HEAD
show_read_files_dir():-
read_files_dir( Tp, Dir ), write( Tp ), write("
"), write( Dir ), write(" "), nl, fail, !.
show_read_files_dir():- write("
"), !.
% eval_tag( 'rust', Linum, Taglow, F , Sline , Ari)
% eval_tag( 'rust', Linum, Taglow, F , Sline , Ari)
%only_small_number_of_occurences_display( Num_oc, Files_list_s0, Files_list_s ),
%only_small_number_of_occurences_display( Num_oc2, Files_list_s02, Files_list_s2 ),
% find_metta_test_occurences( El_tag, Numberof_s, _Files_list ),
write_csv_val( Sx ) :- str_code_remove( Sx, 39, Sx2 ),
str_code_remove( Sx2, 91, Sx3 ), str_code_remove( Sx3, 93, Sx4 ),
str_code_remove( Sx4, 60, Sx5 ), str_code_remove( Sx5, 62, Sx6 ),
str_code_remove( Sx6, 47, Sx7 ),
str_code_remove( Sx7, 40, Sx8 ), str_code_remove( Sx8, 41, Sx9 ), str_code_remove( Sx9, 58, Sx10 ),
str_code_remove( Sx10, 59, Sx11 ),
write( Sx11 ).
write_csv_cols( [] ):- !.
write_csv_cols( [ H ] ):- !, write_csv_val( H ) .
write_csv_cols( [ H | Rest ] ):- !, write_csv_val( H ), write( ";" ), write_csv_cols( Rest ).
make_rust_prolog_table():- show_read_files_dir(),
write( "
" ),
retractall( tel(_)) , assert( tel( 0 ) ), write( "" ),
write_head( " " ), write_head( "function" ), write_head( "Rust" ), write_head( "Prolog" ),
write_head( "Occurs in metta-files" ), write_head( "Has metta-files" ),
write_head( "Has @doc" ), write_head( "@doc TYPE decl" ),
write_head( "Num of metta-test" ), write_head( "Has metta-testf" ),
write( "
" ), tag_for_table( El_tag ), is_metta_function( El_tag ),
incr( Count ), number_string( Count, Sx ),
get_tag_properties( El_tag, Hasrust, Hasprolog ),
get_tag_occurences( El_tag , _Num_oc, Occurences_string , Files_list_s ),
get_tag_occurences_test( El_tag , _Num_oc2, Occurences_string2 , Files_list_s2 ),
find_has_metta_doc( El_tag , Has_doc_s ),
find_has_metta_type_doc( El_tag , _Has_tdoc_s , Type_descr ),
write( "" ), write_cell( Sx ),
write_cell( El_tag ), write_cell( Hasrust ), write_cell( Hasprolog ),
write_cell( Occurences_string ), write_cell( Files_list_s ),
write_cell( Has_doc_s ), write_cell_pre( Type_descr ), write_cell( Occurences_string2 ), write_cell( Files_list_s2 ),
write( "
" ), fail, !.
make_rust_prolog_table():- write( "
" ), !.
make_rust_prolog_csv():-
retractall( tel(_)) , assert( tel( 0 ) ),
write_csv_cols( [ "num" , "function" , "Rust" , "Prolog" , "Occurs in metta-files" , "Has metta-files" ,
"Has @doc" , "@doc TYPE decl" , "Num of metta-test" , "Has metta-testf" ]), write("\r"), nl,
tag_for_table( El_tag ), is_metta_function( El_tag ),
incr( Count ), number_string( Count, Sx ),
get_tag_properties( El_tag, Hasrust, Hasprolog ),
get_tag_occurences( El_tag , _Num_oc, Occurences_string , Files_list_s ),
get_tag_occurences_test( El_tag , _Num_oc2, Occurences_string2 , Files_list_s2 ),
find_has_metta_doc( El_tag , Has_doc_s ),
find_has_metta_type_doc( El_tag , _Has_tdoc_s , Type_descr ),
write_csv_cols( [ Sx , El_tag , Hasrust , Hasprolog , Occurences_string , Files_list_s ,
Has_doc_s , Type_descr , Occurences_string2 , Files_list_s2 ] ), write("\r"), nl,
fail, !.
make_rust_prolog_csv():- write( "" ), !.
=======
make_rust_prolog_table():- write( "
" ),
retractall( tel(_)) , assert( tel( 0 ) ),
% eval_tag( 'rust', Linum, Taglow, F , Sline , Ari)
% eval_tag( 'rust', Linum, Taglow, F , Sline , Ari)
write( "" ),
write_head( " " ), write_head( "function" ), write_head( "Rust" ), write_head( "Prolog" ),
write_head( "Occurs in metta-files" ), write_head( "Has metta-files" ),
write_head( "Has @doc" ),
write_head( "Num of metta-test" ), write_head( "Has metta-testf" ),
write( "
" ),
tag_for_table( El_tag ),
is_metta_function( El_tag ),
incr( Count ), number_string( Count, Sx ),
get_tag_properties( El_tag, Hasrust, Hasprolog ),
get_tag_occurences( El_tag , _Num_oc, Occurences_string , Files_list_s ),
%only_small_number_of_occurences_display( Num_oc, Files_list_s0, Files_list_s ),
get_tag_occurences_test( El_tag , _Num_oc2, Occurences_string2 , Files_list_s2 ),
%only_small_number_of_occurences_display( Num_oc2, Files_list_s02, Files_list_s2 ),
find_has_metta_doc( El_tag , Has_doc_s ),
% find_metta_test_occurences( El_tag, Numberof_s, _Files_list ),
write( "" ), write_cell( Sx ),
write_cell( El_tag ), write_cell( Hasrust ), write_cell( Hasprolog ),
write_cell( Occurences_string ), write_cell( Files_list_s ),
write_cell( Has_doc_s ),
write_cell( Occurences_string2 ), write_cell( Files_list_s2 ),
write( "
" ), fail, !.
make_rust_prolog_table():- write( "
" ), !.
>>>>>>> d3628bb (Update analyse to a Table and after CSV)
memory_data_to_file( Fn ):- tell( Fn ),
eval_tag( A , B , C , D , E, F ), write_term( eval_tag( A , B , C , D , E, F ), [quoted(true)] ), nl, fail.
memory_data_to_file( _Fn ):-
eval_tag_found( A , B , C , D , E, F ), write_term( eval_tag_found( A , B , C , D , E, F ), [quoted(true)] ), nl, fail.
memory_data_to_file( _Fn ):-
found_search_result( A , B , C , D , E, F ), write_term( found_search_result( A , B , C , D , E, F ), [quoted(true)] ), nl, fail.
% eval_tag_secondary/2.
memory_data_to_file( _ ):- told(), ! .
%---
:- dynamic tag_occurences/3.
:- dynamic tag_occurences_test/3.
% max_length_list( [ A,B,C|_], [A,B,C]):- !.
% max_length_list( [ A,B|_], [A,B]):- !.
max_length_list( [ A|_], [A]):- !.
max_length_list(_Files0, []):-!.
get_tag_occurences( Tag , Count, Sx , Files_s ):-
tag_occurences( Tag , Count, Files0 ), max_length_list(Files0, Files), number_string( Count, Sx ), term_string( Files, Files_s, [] ), !.
get_tag_occurences( _Tag , 0, "", "has no metta" ):- !.
%----
get_tag_occurences_test( Tag , Count, Sx , Files_s ):-
tag_occurences_test( Tag , Count, Files0 ), max_length_list(Files0, Files), number_string( Count, Sx ), term_string( Files, Files_s, [] ), !.
get_tag_occurences_test( _Tag , 0, "", "has no metta test" ):- !.
%---
only_small_number_of_occurences_display( Num_oc, Files_list_s, Files_list_s ):- Num_oc < 6, !.
only_small_number_of_occurences_display( _Num_oc, _Files_list_s0, "" ):- !.
% only_small_number_of_occurences_display( _Num_oc, Files_list_s, Files_list_s ):-!.
%----
update_tag_occurences( Tag , Count, Base ):- retract( tag_occurences( Tag , _ , Files0 ) ), !,
sort( [ Base | Files0 ], Files ), assert( tag_occurences( Tag , Count, Files ) ).
update_tag_occurences( Tag , Count, Base ):- assert( tag_occurences( Tag , Count, [Base] ) ).
%--
update_tag_occurences_test( Tag , Count, Base ):- retract( tag_occurences_test( Tag , _ , Files0 ) ), !,
sort( [ Base | Files0 ], Files ), assert( tag_occurences_test( Tag , Count, Files ) ).
update_tag_occurences_test( Tag , Count, Base ):- assert( tag_occurences_test( Tag , Count, [Base] ) ).
%----
count_tags_files_occurences():- retractall( tag_occurences( _ , _ , _ ) ) ,
tag_for_table( Tag ), retractall( tel( _ ) ), assert( tel( 0 ) ),
found_search_result( metta_example , Tag, _Lev , _Line , Fn , _Str_part ),
file_base_name( Fn, Base ), file_name_extension( Base2, _Ext, Base ),
incr( Count ), update_tag_occurences( Tag , Count, Base2 ), fail, ! .
count_tags_files_occurences():- !.
%---
count_tags_files_occurences_test():- retractall( tag_occurences_test( _ , _ , _ ) ) ,
tag_for_table( Tag ), retractall( tel( _ ) ), assert( tel( 0 ) ),
found_search_result( metta_example , Tag, _Lev , _Line , Fn , Str_part ),
sub_string( Str_part, _,_,_, "assert" ),
file_base_name( Fn, Base ), file_name_extension( Base2, _Ext, Base ),
incr( Count ), update_tag_occurences_test( Tag , Count, Base2 ), fail, ! .
count_tags_files_occurences_test():- !.
% found_search_result(metta_example,"match",1,3,'../../tests/baseline_compat/metta-morph_tests/match_feval.metta',"!(match &self (= (f $x) $y) $y)")
% eval_tag(metta_tag_std_lib,1225,"print",'../canary/stdlib_mettalog.metta',"(@doc print-mods!\n (@desc \"Prints all modules with their correspondent spaces\")\n (@params ())\n (@return \"Unit atom\"))",0)
% found_search_result(metta_example,
% "match",1,3,'../
% eval_tag(metta_tag_std_lib,1348,"format-args",'../canary/stdlib_me
% eval_tag(metta_example,58,"let*",'../../tests/baseline_compat/hyp
<<<<<<< HEAD
% create_view_table().
create_view_table():- !,
start_analyse( 'display_per_tag', 'rust_leading', 0, '', is_dummy_tag, include_metta_files ).
=======
>>>>>>> d3628bb (Update analyse to a Table and after CSV)
%---
start_analyse_metta( Display_per_file_or_per_tag, LeadingTag, Tp, MdfKeyaft, Is_mk_update, _X , Inc_Metta ):- !,
retractall( eval_tag( _, _, _ , _,_ , _ ) ),
retractall( eval_tag_secondary( _ , _ ) ),
retractall( eval_tag_found( _ , _ , _ , _, _ ,_ ) ),
retractall( found_search_result( _,_, _, _, _, _ ) ),
retractall( per_file( _ ) ),
% retractall( extra_string_to_search( _ ) ),
% assert( extra_string_to_search( "count" ) ),
% chercher_a( Zk ),
Zk = "",
today_key( Dk ), write( "today key " ), write( Dk ), Xfi = 'data/htm_file_list.pl',
short_code_metta( Inc_Metta, Short_code ),
atomic_list_concat([ 'result/analyse_result_', LeadingTag, '_', Display_per_file_or_per_tag, '_', Short_code, '.htm' ], Htmfile ),
reset_htm( Display_per_file_or_per_tag, LeadingTag, Inc_Metta, Htmfile ),
% search_all_files_with_prolog_leading( Tp, Dk, Zk, MdfKeyaft, Is_mk_update, Xfi ),
search_all_files_with_leading( LeadingTag, Tp, Dk, Zk, MdfKeyaft, Is_mk_update, Xfi , Inc_Metta ),
% search_all_files_with_rust_leading( Tp, Dk, Zk, MdfKeyaft, Is_mk_update, Xfi ),
memory_data_to_file( 'data/tags_data.pl' ),
set_tags_for_table(),
count_tags_files_occurences(),
count_tags_files_occurences_test(),
append( Htmfile ),
% TEMP turn off
% display_metta_sresults( Display_per_file_or_per_tag , Zk, 'dummyxxaaq' ),
% show_identified_eval_tags( 'rust' ),
% show_identified_eval_tags( 'pl_tag' ),
% show_identified_eval_tags( 'python' ),
% show_identified_eval_tags( 'pl_interp_tag' ),
% show_identified_eval_tags( 'metta_tag' ),
% show_identified_eval_tags( 'metta_tag_extra' ),
% show_tags_which_dont_have_tests(),
% show_identified_eval_secondary_tags(),
% display_tags_not_found(),
make_rust_prolog_table(),
<<<<<<< HEAD
=======
retractall( eval_tag_found( _ , _ , _, _, _ ,_) ),
>>>>>>> d3628bb (Update analyse to a Table and after CSV)
told(),
tell( 'result/prolog_rust.csv' ), make_rust_prolog_csv(), told(),
retractall( eval_tag_found( _ , _ , _, _, _ ,_) ),
write( "analyses result written to file: \n" ),
write( Htmfile ), nl.
make_csv():- !,
tell( 'result/prolog_rust.csv' ), make_rust_prolog_csv(), told().
test11():- atom_codes( '42 times' , Codes ),
phrase( integer( X ), Codes, _Res ),
write( X ), nl .
%eval20claus( Lis ) --> "eval_20(" , Lis .
%test12():- string_codes( "eval_20( aaqq ", Codes ),
% phrase( eval20claus( Lis ), Codes, _P ) ,
% write_term( Lis, [] ), nl.
komma --> [C], { C == 44 }.
leftparenthese --> [C], { C == 40 }.
leftbracket --> [C], { C == 91 }.
rightbracket --> [C], { C == 93 }.
singlequote --> [C], { C == 39 }.
% tag_x( foo ) --> "foo" .
% tag_x( bar( A, B ) ) --> "bar", whites, digits( ACodes ), whites, digits( BCodes ), { number_codes( A, ACodes), number_codes( B, BCodes ) }.
% tag_x( bar( A, B ) ) --> "bar(", whites , digits( ACodes ), whites, komma , whites, digits( BCodes ), { number_codes( A, ACodes), number_codes( B, BCodes ) }.
%tag_x( bar( Vn , B ) ) --> "bar(", whites , prolog_var_name( Vn ), whites, komma , whites, digits( BCodes ), { number_codes( B, BCodes ) }.
% tag_x( eval20( A , A2, A3, A4, B , X5 ) ) --> "eval_20(", whites , string( Vn ), whites, komma , whites,
%tag_x( eval20( B ) ) --> "eval_20(", whites , string( Vn ), whites, komma , whites,
% string( Vn2 ), whites, komma , whites ,
% string( Vn3 ), whites, komma , whites ,
% string( Vn4 ), whites, komma , whites ,
% leftbracket , whites, singlequote , string( BCodes ), singlequote, whites, komma ,
% string( Rest5 ),
% { string_codes( _A, Vn ), string_codes( _A2, Vn2 ), string_codes( _A3, Vn3 ), string_codes( _A4, Vn4 ), string_codes( B, BCodes ), string_codes( _X5, Rest5 ) }.
tag_x( eval20( B , X5q ) ) --> "eval_20(", whites , string( Vn ), whites, komma , whites,
string( Vn2 ), whites, komma , whites ,
string( Vn3 ), whites, komma , whites ,
string( Vn4 ), whites, komma , whites ,
leftbracket , whites, singlequote , string( BCodes ), singlequote, whites, komma ,
string( Rest5 ), rightbracket,
string( _Rest6 ),
{ string_codes( _A, Vn ), string_codes( _A2, Vn2 ), string_codes( _A3, Vn3 ), string_codes( _A4, Vn4 ), string_codes( B, BCodes ), string_codes( X5q, Rest5 ) }.
%---
tag_x40( eval40( B , X5q ) ) --> "eval_40(", whites , string( Vn ), whites, komma , whites,
string( Vn2 ), whites, komma , whites ,
string( Vn3 ), whites, komma , whites ,
string( Vn4 ), whites, komma , whites ,
leftbracket , whites, singlequote , string( BCodes ), singlequote, whites, komma ,
string( Rest5 ), rightbracket,
string( _Rest6 ),
{ string_codes( _A, Vn ), string_codes( _A2, Vn2 ), string_codes( _A3, Vn3 ), string_codes( _A4, Vn4 ), string_codes( B, BCodes ), string_codes( X5q, Rest5 ) }.
tag_x70( eval70( B , X5q ) ) --> "eval_70(", whites , string( Vn ), whites, komma , whites,
string( Vn2 ), whites, komma , whites ,
string( Vn3 ), whites, komma , whites ,
string( Vn4 ), whites, komma , whites ,
leftbracket , whites, singlequote , string( BCodes ), singlequote, whites, komma ,
string( Rest5 ), rightbracket,
string( _Rest6 ),
{ string_codes( _A, Vn ), string_codes( _A2, Vn2 ), string_codes( _A3, Vn3 ), string_codes( _A4, Vn4 ), string_codes( B, BCodes ), string_codes( X5q, Rest5 ) }.
%:- discontiguous eval_40/6.
%:- discontiguous eval_70/6.
% tag_x( quux( S ) ) --> "quux", whites, nonblanks( Codes ), { string_codes( S, Codes ) }.
tag_list( [ Tag_token | Tags_tokens ]) --> tag_x( Tag_token ), whites, tag_list( Tags_tokens ).
tag_list( [] ) --> [].
tag_list40( [ Tag_token | Tags_tokens ]) --> tag_x40( Tag_token ), whites, tag_list40( Tags_tokens ).
tag_list40( [] ) --> [].
tag_list70( [ Tag_token | Tags_tokens ]) --> tag_x70( Tag_token ), whites, tag_list70( Tags_tokens ).
tag_list70( [] ) --> [].
try_read_find_eval20_tag_in_string( Str , Result_tag, Len ):-
% string_codes( "eval_20( _Zxs , Pq , _Za , Qe, ['jajaj',Atom],CDR_Y):- !, Atom=[_|CDR],!,do_expander(Eq,RetType,CDR,CDR_Y).", Codes_x ),
string_codes( Str , Codes_x ), phrase( tag_list( Tags_tokens ), Codes_x ), Tags_tokens = [ Xres ], Xres = eval20( Result_tag, Rest_Args ) ,
split_string( Rest_Args , ",", "" , Lis ), length( Lis, Len ), !.
try_read_find_eval20_tag_in_string( Str , Result_tag, Len ):-
% string_codes( "eval_20( _Zxs , Pq , _Za , Qe, ['jajaj',Atom],CDR_Y):- !, Atom=[_|CDR],!,do_expander(Eq,RetType,CDR,CDR_Y).", Codes_x ),
string_codes( Str , Codes_x ), phrase( tag_list40( Tags_tokens ), Codes_x ), Tags_tokens = [ Xres ], Xres = eval40( Result_tag, Rest_Args ) ,
split_string( Rest_Args , ",", "" , Lis ), length( Lis, Len ), !.
try_read_find_eval20_tag_in_string( Str , Result_tag, Len ):-
% string_codes( "eval_20( _Zxs , Pq , _Za , Qe, ['jajaj',Atom],CDR_Y):- !, Atom=[_|CDR],!,do_expander(Eq,RetType,CDR,CDR_Y).", Codes_x ),
string_codes( Str , Codes_x ), phrase( tag_list70( Tags_tokens ), Codes_x ), Tags_tokens = [ Xres ], Xres = eval70( Result_tag, Rest_Args ) ,
split_string( Rest_Args , ",", "" , Lis ), length( Lis, Len ), !.
% eval_20(Eq,RetType,_Dpth,_Slf,['cdr-atom',Atom],CDR_Y):- !, Atom=[_|CDR],!,do_expander(Eq,RetType,CDR,CDR_Y).
test12():-
% phrase(commands(Commands), `bar 1 2 foo quux bloop`),
% string_codes( "eval_20( _Zxs , _Pa foo quux bloop", Codes_x ),
% string_codes( "eval_20( _Zxs , Pq , _Za , Qe, ['jajaj',Atom],CDR_Y):- !, Atom=[_|CDR],!,do_expander(Eq,RetType,CDR,CDR_Y).", Codes_x ),
% phrase( tag_list( Tags_tokens ), Codes_x ),
% Tags_tokens = [ Xres ], Xres = eval20( Result_tag ) , !,
try_read_find_eval20_tag_in_string( "eval_70( _Zxs , Pq , _Za , Qe, ['j2ajaj',Atom],CDR_Y):- !, Atom=[_|CDR],!,do_expander(Eq,RetType,CDR,CDR_Y)." , Result_tagx, _ ),
% maplist( writeln, Tags_tokens ).
write_term( Result_tagx , [] ).
%----
% HERE ALL the config
color_for_file_type( Fn , "#ECED99" ):- sub_atom( Fn, _, _, _, '.metta' ), !.
color_for_file_type( Fn , "#A7E3A7" ):- sub_atom( Fn, _, _, _, '.py' ), !.
color_for_file_type( Fn , "#D3D4FF" ):- sub_atom( Fn, _, _, _, '.pl' ), !.
color_for_file_type( Fn , "#FFD6BB" ):- sub_atom( Fn, _, _, _, '.rs' ), !.
color_for_file_type( _Filewithpath, "#E7E7E7" ):- !.
% we dont want all the assertEqual etc here
is_metta_function( Tag ):- string_lower( Tag, Tag_lower ), sub_string( Tag_lower, _,_,_, "assert" ), !, fail.
is_metta_function( "superpose" ):- !, fail.
is_metta_function( "&self" ):- !, fail.
is_metta_function( Tag ):- string_length( Tag, Lex ), Lex > 3, Tag \= "eval", !.
% % { assert_equal_to_result_op.clone() });
rust_detect_tag( "regex(r\"", "\"" , "{", ".clone(" ):- !.
<<<<<<< HEAD
rust_metta_tag( "assert_eq!(", "" ):- !.
python_detect_tag( "metta.run('!(", " " ):- !.
python_metta_tag( "assertequalmettarunnerresults", "" ):- !.
metta_interp_tag( "'", "'" ):- !.
metta_ontology_tag( "'", "'" ):- !.
metta_file_tag_find( "(", " " ):- !.
metta_file_tag( "(", "" ):- !.
metta_file_tag_til_space( "(", " " ):- !.
=======
python_detect_tag( "metta.run('!(", " " ):- !.
metta_interp_tag( "'", "'" ):- !.
metta_ontology_tag( "'", "'" ):- !.
metta_file_tag_find( "(", " " ):- !.
metta_file_tag( "(", "" ):- !.
metta_file_tag_til_space( "(", " " ):- !.
>>>>>>> d3628bb (Update analyse to a Table and after CSV)
metta_function_declaration( "(: ", " " ):- !.
metta_docfile_tag( "(@doc ", "" ):- !.
<<<<<<< HEAD
=======
>>>>>>> d3628bb (Update analyse to a Table and after CSV)
% README HERE: USAGE:
% first consult the prolog file with this :
% [metta_analyse].
% THEN call as below :
% Calling examples :
% start_analyse( 'display_per_tag', 'rust_leading', 0, '', is_dummy_tag, include_metta_files ).
% start_analyse( 'display_per_tag', 'prolog_leading', 0, '', is_dummy_tag, not_include_metta_files ).
% start_analyse( 'display_per_file', 'rust_leading', 0, '', is_dummy_tag , not_include_metta_files).
% start_analyse( 'display_per_file', 'python_leading', 0, '', is_dummy_tag , not_include_metta_files ).
start_analyse( Display_per_tag_or_file, LeadingTag, Tp, MdfKeyaft, Is_mk_update , Inc_metta ):-
start_analyse_metta( Display_per_tag_or_file, LeadingTag, Tp, MdfKeyaft, Is_mk_update, 'xdummy' , Inc_metta ),
fail, !.
start_analyse( _, _, _Tp, _MdfKeyaft, _Is_mk_update , _ ):- !.
wri_rust( Lx , Linum , F ):-
rust_detect_tag( Tag_from, Tag_til , Second_tag_begin, Second_tag_end ),
sub_str_between( Lx, Tag_from, Tag_til, Subz10 ),
% replace
str_code_remove( Subz10, 92, Subz1 ),
% is_metta_function(
is_metta_function( Subz1 ),
sub_str_between( Lx, Second_tag_begin, Second_tag_end, Subz2 ),
assert_eval_tag( 'rust', Linum, Subz1, F, Lx , 0),
% not( eval_tag( _, Subz1, _ ) ), assert( eval_tag( Linum, Subz1, F ) ),
asserta( found_search_result( 'rust', Subz1 , 0, Linum, F, Lx ) ),
write( Subz1 ), nl,
not( eval_tag_secondary( _, Subz2 ) ), assert( eval_tag_secondary( Subz1, Subz2 ) ), ! .
%wri_rust( Lx , _, F ):-
% sub_string( Lx , _, _, _ , "regex" ), !, write("is_line-"), write( Lx ), nl .
wri_rust( _Lx, _ , _ ):- !.
% end_of
read_rust_stream( Sea , N, Fnx ):-
read_line_to_string( Sea, Lx ), Lx \= end_of_file, !,
% write( Lx ), nl,
wri_rust( Lx , N , Fnx ), N2 is N + 1,
read_rust_stream( Sea , N2 , Fnx).
read_rust_stream( _Sea , _ ,_):- !.
% '../../../hyperon-experimental/lib/src/metta/runner/stdlib.rs'
read_rustfile_tags( Fnx ):-
retractall( eval_tag( _, _, _, _ , _ , _ ) ),
retractall( eval_tag_secondary( _, _ ) ),
open( Fnx , read, Sea , [ encoding(octet) ] ),
read_rust_stream( Sea, 1, Fnx ),
close( Sea ).