text stringlengths 0 234 |
|---|
end if; |
end loop; |
Put_Line (txt, "end "&the_name&";"); |
end write_procedure_end; |
procedure add_declarations is |
src : File_Type; |
count : integer; |
max_count : integer; |
width : integer; |
target : integer; |
lead_in : integer; |
num_chars : integer; |
tmp_xvars : Integer; |
num_xvars : Integer; |
max_width : Integer; |
type action_list is (wrote_xvar, wrote_type, wrote_space); |
last_action : action_list; |
begin |
-- first pass: count the number of xvars and record max width |
Open (src, In_File, src_file_name); |
num_xvars := 0; -- number of xvars |
max_width := 0; -- maximum widt of the xvars |
loop |
begin |
declare |
re_numb : String := "^ *"&symbol&"([0-9]+) +="; |
this_line : String := get_line (src); |
this_numb : String := grep (this_line, re_numb, 1, fail => "<no-match>"); |
begin |
if this_numb /= "<no-match>" then |
num_xvars := num_xvars + 1; |
max_width := max (max_width, this_numb'length); |
end if; |
Function Definition: procedure Ada_Merge is |
Function Body: txt : File_Type; |
max_recurse_depth : Constant := 10; |
recurse_depth : Integer := 0; |
src_file_name : String := read_command_arg ('i',"<no-source>"); |
out_file_name : String := read_command_arg ('o',"<no-output>"); |
silent : Boolean := find_command_arg ('S'); -- true: do not wrap include text in beg/end pairs |
markup : Boolean := not silent; -- true: do wrap include text in beg/end pairs |
function File_Exists (the_file_name : string) return boolean renames Ada.Directories.Exists; |
procedure include_files |
(prev_path : String; |
this_line : String; |
prev_indent : Integer) |
is |
-- allow simple variations of the Input syntax: |
-- \Input for TeX, use \Input to avoid confusion with \input |
-- $Input for Ada/Python/Cadabra |
-- note that this is only for convenience, the comment string will be deduced |
-- from the file extension of the Input'ed file |
re_inc_file : String := "^[\t ]*(\\|\$)Input\{""([_a-zA-Z0-9./-]+)""\}"; |
-- this function is not used |
function not_tex_comment |
(the_line : String) |
return Boolean |
is |
re_tex_comment : String := "^\s*%"; |
begin |
return (not grep (the_line, re_tex_comment)); |
end not_tex_comment; |
function is_include_file |
(the_line : String) |
Return Boolean |
is |
begin |
return grep (the_line,re_inc_file); |
end is_include_file; |
function absolute_path |
(the_path : String; -- full path to most recent include file, e.g. foo/bah/cow.tex |
the_line : String) -- contains relative path to new include file, e.g., \Input{"cat/dot/fly.tex"} |
Return String -- full path to new include file, e.g., foo/bah/cat/dog/fly.tex |
is |
re_dirname : String := "([_a-zA-Z0-9./-]*\/)"; -- as per dirname in bash |
tmp_path : String (1..the_path'last+the_line'last); -- overestimate length of string |
new_path : String (1..the_path'last+the_line'last); |
begin |
-- drop the simple file name from the existing path |
writestr (tmp_path, trim ( grep (the_path,re_dirname,1,fail => "") )); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.