diff options
author | Ralph Amissah <ralph.amissah@gmail.com> | 2020-01-05 20:17:17 -0500 |
---|---|---|
committer | Ralph Amissah <ralph.amissah@gmail.com> | 2020-02-11 13:08:49 -0500 |
commit | de02319cfa7b4bbff8c111bda02be1a7c6591555 (patch) | |
tree | 732c11d10bc2699cd1b72d00b3be943284eea130 /org/out_latex.org | |
parent | reduce use of auto, much with tuples (diff) |
dlang safe default imminent, look ahead
- @safe @trusted & @system, reconsider @trusted
Diffstat (limited to 'org/out_latex.org')
-rw-r--r-- | org/out_latex.org | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/org/out_latex.org b/org/out_latex.org index 8a84ceb..cb73d5c 100644 --- a/org/out_latex.org +++ b/org/out_latex.org @@ -129,7 +129,7 @@ import #+BEGIN_SRC d auto paper() { struct PaperType { - auto a4() @safe { + @safe auto a4() { struct A4 { auto portrait() { struct V { @@ -150,7 +150,7 @@ import } return A4(); } - auto a5() @safe { + @safe auto a5() { struct A5 { auto portrait() { struct V { @@ -171,7 +171,7 @@ import } return A5(); } - auto b4() @safe { + @safe auto b4() { struct B4 { auto portrait() { struct V { @@ -192,7 +192,7 @@ import } return B4(); } - auto letter() @safe { + @safe auto letter() { struct Letter { auto portrait() { struct V { @@ -213,7 +213,7 @@ import } return Letter(); } - auto legal() @safe { + @safe auto legal() { struct Legal { auto portrait() { struct V { @@ -244,10 +244,10 @@ import #+name: output_latex_shared #+BEGIN_SRC d -string sp_char_esc(O)( +@safe string sp_char_esc(O)( string _txt, const O obj, -) @safe { +) { string _unescape_sp_char_esc()(string _txt) { _txt = _txt .replaceAll(rgx.latex_special_char_escaped, @@ -273,9 +273,9 @@ string sp_char_esc(O)( #+name: output_latex_shared #+BEGIN_SRC d -string sp_char_esc_txt()( +@safe string sp_char_esc_txt()( string _txt, -) @safe { +) { string _unescape_sp_char_esc()(string _txt) { _txt = _txt .replaceAll(rgx.latex_special_char_escaped, @@ -300,9 +300,9 @@ string sp_char_esc_txt()( *** not used latex \escape special characters #+BEGIN_SRC d -string sp_char_esc()( +@safe string sp_char_esc()( string _txt, -) @safe { +) { _txt = replaceAll!(m => "\\" ~ m[1])(_txt, rgx.latex_special_char); return _txt; } @@ -315,9 +315,9 @@ string sp_char_esc()( #+name: output_latex_shared #+BEGIN_SRC d -string fontface()( +@safe string fontface()( string _txt, -) @safe { +) { _txt = _txt .replaceAll(rgx.inline_emphasis, format(q"┃\begin{bfseries}%s\end{bfseries}┃", "$1")) .replaceAll(rgx.inline_bold, format(q"┃\begin{bfseries}%s\end{bfseries}┃", "$1")) @@ -338,9 +338,9 @@ _txt = _txt #+name: output_latex_shared #+BEGIN_SRC d -string leading_hardspaces()( +@safe string leading_hardspaces()( string _txt, -) @safe { +) { string hardspaces(string _spaces) { _spaces = _spaces .replaceAll(rgx.space, "\\hardspace "); @@ -355,7 +355,7 @@ string leading_hardspaces()( #+name: output_latex_shared #+BEGIN_SRC d -string nbsp_char()(string _txt) @safe { +@safe string nbsp_char()(string _txt) { if (_txt.match(rgx.nbsp_char)) { _txt = _txt.replaceAll(rgx.nbsp_char, "\\hardspace "); } @@ -367,7 +367,7 @@ string nbsp_char()(string _txt) @safe { #+name: output_latex_shared #+BEGIN_SRC d -string nbsp_char_to_space()(string _txt) @safe { +@safe string nbsp_char_to_space()(string _txt) { if (_txt.match(rgx.nbsp_char)) { _txt = _txt.replaceAll(rgx.nbsp_char, " "); } @@ -380,11 +380,11 @@ string nbsp_char_to_space()(string _txt) @safe { #+name: output_latex_shared #+BEGIN_SRC d -string links_and_images(O,M)( +@safe string links_and_images(O,M)( string _txt, const O obj, M doc_matters, -) @safe { +) { if (obj.has.inline_links) { // TODO some images do not have inline links ... image without link string _width_adjust(string _width) { if (_width.to!int > 300) { _width = "300"; } // will need to vary max with papersize & orientation @@ -432,9 +432,9 @@ string links_and_images(O,M)( #+name: output_latex_shared #+BEGIN_SRC d -string footnotes()( +@safe string footnotes()( string _txt, -) @safe { +) { if (_txt.match(rgx.inline_notes_al_gen)) { string _tex_note = q"┃\hypertarget{noteref_%s}{}\footnote[%s]{%% \label{note_%s}%s}┃"; @@ -453,9 +453,9 @@ string footnotes()( #+name: output_latex_shared #+BEGIN_SRC d -string remove_footnotes()( +@safe string remove_footnotes()( string _txt, -) @safe { +) { if (_txt.match(rgx.inline_notes_al_gen)) { _txt = replaceAll!(m => "")(_txt, rgx.inline_notes_al_gen); } @@ -468,10 +468,10 @@ string remove_footnotes()( #+name: output_latex_shared #+BEGIN_SRC d -string para(O)( +@safe string para(O)( string _txt, O obj, -) @safe { +) { if (obj.metainfo.is_of_type == "para") { string _tex_para; _tex_para = q"┃\begin{tiny}\hspace{0mm}\end{tiny}{\marginpar{\begin{tiny}\hspace{0mm}\hypertarget{%s}{%s}\end{tiny}}}%s┃"; @@ -489,10 +489,10 @@ string para(O)( #+name: output_latex_shared #+BEGIN_SRC d -string bookindex(O)( +@safe string bookindex(O)( string _txt, O obj, -) @safe { +) { if (obj.metainfo.is_of_type == "para" && obj.metainfo.is_a == "bookindex" ) { @@ -510,10 +510,10 @@ string bookindex(O)( #+name: output_latex_head #+BEGIN_SRC d -string bullets_and_indentation(O)( +@safe string bullets_and_indentation(O)( string _txt, O obj, -) @safe { +) { string _tex_para; string _hang; string _indent; int _paper_margin = -10; @@ -555,12 +555,12 @@ string bullets_and_indentation(O)( #+name: output_latex_shared_0 #+BEGIN_SRC d - string heading(O,M)( + @safe string heading(O,M)( string _txt, O obj, M doc_matters, string _part = "" - ) @safe { + ) { if (obj.metainfo.is_a == "heading") { string _tex_para; string _pg_break; |