Skip to content
Snippets Groups Projects
Commit bbb249dd authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Merge branch 'macroexp' into 'master'

savemacro: use valid filename

Closes #126

See merge request !105
parents c04aa571 ff6aef0e
No related branches found
No related tags found
1 merge request!105savemacro: use valid filename
Pipeline #10591 passed
...@@ -633,7 +633,7 @@ end; ...@@ -633,7 +633,7 @@ end;
\begin{frame} \begin{frame}
\frametitle{Macro-related command line options} \frametitle{Macro-related command line options}
\begin{itemize} \begin{itemize}
\item \texttt{savemacro}: Useful for debugging or learning purposes, saves the output of the macro processor. If your \texttt{.mod} file is called \texttt{file.mod}, the output is saved to \texttt{file-macroexp.mod}. \item \texttt{savemacro}: Useful for debugging or learning purposes, saves the output of the macro processor. If your \texttt{.mod} file is called \texttt{file.mod}, the output is saved to \texttt{file\_macroexp.mod}.
\item NB: \texttt{savemacro=filename} allows a user-defined file name \item NB: \texttt{savemacro=filename} allows a user-defined file name
\item \texttt{linemacro}: In the output of \texttt{savemacro}, print line numbers where the macro directives were placed. \item \texttt{linemacro}: In the output of \texttt{savemacro}, print line numbers where the macro directives were placed.
\item \texttt{onlymacro}: Stops processing after the macro processing step. \item \texttt{onlymacro}: Stops processing after the macro processing step.
......
...@@ -41,7 +41,7 @@ macroExpandModFile(const filesystem::path& filename, const istream& modfile, boo ...@@ -41,7 +41,7 @@ macroExpandModFile(const filesystem::path& filename, const istream& modfile, boo
if (save_macro) if (save_macro)
{ {
if (save_macro_file.empty()) if (save_macro_file.empty())
save_macro_file = filename.stem().string() + "-macroexp.mod"; save_macro_file = filename.stem().string() + "_macroexp.mod";
ofstream macro_output_file {save_macro_file}; ofstream macro_output_file {save_macro_file};
if (macro_output_file.fail()) if (macro_output_file.fail())
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment