Skip to content

Commit

Permalink
#81 (jobname: 'あſ' does not work)
Browse files Browse the repository at this point in the history
  • Loading branch information
h-kitagawa committed Jun 9, 2019
1 parent 76536aa commit 5d57faa
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 11 deletions.
68 changes: 58 additions & 10 deletions source/texk/web2c/ptexdir/ptex-base.ch
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ exit:end;
@z
@x l.1603 - pTeX
@<Basic print...@>=
procedure print(@!s:integer); {prints string |s|}
label exit;
var j:pool_pointer; {current character code position}
Expand Down Expand Up @@ -330,6 +331,13 @@ while j<str_start[s+1] do
end;
exit:end;
@y
@<Glob...@>=
is_print_filename: boolean;
@ @<Set init...@>=
is_print_filename:=false;
@ @<Basic print...@>=
procedure print(@!s:integer); {prints string |s|}
label exit;
var j:pool_pointer; {current character code position}
Expand All @@ -347,15 +355,20 @@ else if s<256 then
end;
nl:=new_line_char; new_line_char:=-1;
{temporarily disable new-line character}
j:=str_start[s];
while j<str_start[s+1] do
begin print_char(so(str_pool[j])); incr(j);
end;
if is_print_filename then print_char_raw(s)
else begin
j:=str_start[s];
while j<str_start[s+1] do
begin print_char(so(str_pool[j])); incr(j);
end;
end;
new_line_char:=nl; return;
end;
j:=str_start[s];
while j<str_start[s+1] do
begin print_char(so(str_pool[j])); incr(j);
begin
if is_print_filename then print_char_raw(so(str_pool[j])) else print_char(so(str_pool[j]));
incr(j);
end;
exit:end;
@z
Expand Down Expand Up @@ -2553,6 +2566,31 @@ string_code:if cur_cs<>0 then sprint_cs(cur_cs)
else print_kanji(cx);
@z

@x
font_name_code: begin print(font_name[cur_val]);
if font_size[cur_val]<>font_dsize[cur_val] then
begin print(" at "); print_scaled(font_size[cur_val]);
print("pt");
end;
end;
@y
font_name_code: begin
is_print_filename:=true; print(font_name[cur_val]); is_print_filename:=false;
if font_size[cur_val]<>font_dsize[cur_val] then
begin print(" at "); print_scaled(font_size[cur_val]);
print("pt");
end;
end;
@z

@x
job_name_code: print(job_name);
@y
job_name_code: begin
is_print_filename:=true; print(job_name); is_print_filename:=false;
end;
@z

@x [28.487] l.9852 - pTeX: iftdir, ifydir, ifddir, iftbox, ifybox, ifdbox
@d if_case_code=16 { `\.{\\ifcase}' }
@y
Expand Down Expand Up @@ -2695,18 +2733,21 @@ else begin str_room(1); append_char(c); {contribute |c| to the current string}
end;
@z

@x [29] pTeX: print file name
@x [29] pTeX: print_file_name
@d print_quoted(#) == {print string |#|, omitting quotes}
if #<>0 then
for j:=str_start[#] to str_start[#+1]-1 do
if so(str_pool[j])<>"""" then
print(so(str_pool[j]))
@y
@d print_quoted(#) == {print string |#|, omitting quotes}
if #<>0 then
for j:=str_start[#] to str_start[#+1]-1 do
if so(str_pool[j])<>"""" then
if so(str_pool[j])>=@"80 then print_char_raw(so(str_pool[j])) else print(so(str_pool[j]))
begin is_print_filename:=true;
if #<>0 then
for j:=str_start[#] to str_start[#+1]-1 do
if so(str_pool[j])<>"""" then
print(so(str_pool[j]));
is_print_filename:=false;
end
@z

@x [29.526] l.10668 - pTeX: scan file name
Expand Down Expand Up @@ -2761,6 +2802,13 @@ else
wlog(')');
@z

@x [29] pTeX: file name
slow_print(full_source_filename_stack[in_open]); update_terminal;
@y
is_print_filename:=true; slow_print(full_source_filename_stack[in_open]); is_print_filename:=false;
update_terminal;
@z

@x [30.560] l.10968 - pTeX:
This is called BigEndian order.
@!@^BigEndian order@>
Expand Down
3 changes: 2 additions & 1 deletion source/texk/web2c/ptexdir/tests/printkanji.tex
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
%\scrollmode
\tracingstats=1000
\noautoxspacing
\newlinechar=`\^^J
\font\x=ec-lmtt10 \x
\message{^^J}
\def\A{^^c5^^bf ſ 顛}
\edef\B{\meaning\A}
\edef\B{\meaning\A:\jobname:}
\message{^^J}

\A
Expand Down

0 comments on commit 5d57faa

Please sign in to comment.