mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-28 20:45:47 +00:00
fix parsing of \let: tex2lyx must not enclose the arguments with {}.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37016 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
8f037c8e91
commit
84be0a0db4
@ -477,7 +477,7 @@ $$
|
|||||||
\labelitemiv
|
\labelitemiv
|
||||||
\language{}
|
\language{}
|
||||||
% We need this because the arguments must not be interpreted
|
% We need this because the arguments must not be interpreted
|
||||||
\let{}{}
|
\let{item}{item}
|
||||||
% \line(,){} %picture
|
% \line(,){} %picture
|
||||||
\linebreak[]
|
\linebreak[]
|
||||||
\linethickness{}
|
\linethickness{}
|
||||||
|
@ -189,6 +189,8 @@ void read_command(Parser & p, string command, CommandMap & commands)
|
|||||||
string const arg = p.getArg('{', '}');
|
string const arg = p.getArg('{', '}');
|
||||||
if (arg == "translate")
|
if (arg == "translate")
|
||||||
arguments.push_back(required);
|
arguments.push_back(required);
|
||||||
|
else if (arg == "item")
|
||||||
|
arguments.push_back(item);
|
||||||
else
|
else
|
||||||
arguments.push_back(verbatim);
|
arguments.push_back(verbatim);
|
||||||
} else {
|
} else {
|
||||||
|
@ -100,6 +100,7 @@ std::string active_environment();
|
|||||||
enum ArgumentType {
|
enum ArgumentType {
|
||||||
required,
|
required,
|
||||||
verbatim,
|
verbatim,
|
||||||
|
item,
|
||||||
optional
|
optional
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -585,6 +585,15 @@ void parse_arguments(string const & command,
|
|||||||
parse_text(p, os, FLAG_ITEM, outer, context);
|
parse_text(p, os, FLAG_ITEM, outer, context);
|
||||||
ert = "}";
|
ert = "}";
|
||||||
break;
|
break;
|
||||||
|
case item:
|
||||||
|
// This argument consists only of a single item.
|
||||||
|
// The presence of '{' or not must be preserved.
|
||||||
|
p.skip_spaces();
|
||||||
|
if (p.next_token().cat() == catBegin)
|
||||||
|
ert += '{' + p.verbatim_item() + '}';
|
||||||
|
else
|
||||||
|
ert += p.verbatim_item();
|
||||||
|
break;
|
||||||
case verbatim:
|
case verbatim:
|
||||||
// This argument may contain special characters
|
// This argument may contain special characters
|
||||||
ert += '{' + p.verbatim_item() + '}';
|
ert += '{' + p.verbatim_item() + '}';
|
||||||
|
Loading…
Reference in New Issue
Block a user