
/*

CLASS {Source|_of_class_OLD_to_compile_with_primary_compiler}, UNTESTED :

IMPORT: {Compiler}, {Parser}, {Text_parser}, {Type}, {Text_file}, 
        {String_functions}, {File_path} ;
//DEBUG IMPORT: {File_stream}, {Stream}, {File_path} ;


BOOL Remove_comments
BOOL Check_len
BOOL Encoding_ascii|dummy

METHOD Load|_source(
{Type} Class|_this, {Compiler} C|ompiler) 
    :
    PUSH C.Current_class = Class :
        Class.Parse = {Parser}(Compiler_ = C, Class_ = Class)
        temp|_text = {Text_file}(Path = Class.Path, Encoding = 'UTF8')
        CASE ext(Class.Path).Lower == ".pas" ? temp.Encoding = 'DEFAULT' ;
        NONE = temp.Load(Class.Parse.Source[])
        CASE Remove_comments ?
        	 INT last|_line = Class.Parse.Remove_comments ;
        CASE Check_len ?
        	 Class.Parse.Check_lines_len(last) ;
        //DEBUG:
        //      {File_stream} save|_temp = Write_file_stream(C.Destination 
        //      	"" Class.Path.Extract_file_name ".clean.txt", FALSE)
        //      FOR i IN [0 TO last] :
        //          NONE = save.Write_line(Class.Parse.Source[i]) ;
        //	  save.Close
        //;
        Class.Parse.Merge_continued(last) ; .
        
FUN ext|ension(STR Path|_full) ==> STR :
	FOR i IN [Path.Len-1 DOWNTO 0] :
	    CASE Path[i] == "." ? RESULT = Path[i TO *] ==> ;
	; .
	

END

*/
