mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 02:49:46 +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
|
||||
\language{}
|
||||
% We need this because the arguments must not be interpreted
|
||||
\let{}{}
|
||||
\let{item}{item}
|
||||
% \line(,){} %picture
|
||||
\linebreak[]
|
||||
\linethickness{}
|
||||
|
@ -189,6 +189,8 @@ void read_command(Parser & p, string command, CommandMap & commands)
|
||||
string const arg = p.getArg('{', '}');
|
||||
if (arg == "translate")
|
||||
arguments.push_back(required);
|
||||
else if (arg == "item")
|
||||
arguments.push_back(item);
|
||||
else
|
||||
arguments.push_back(verbatim);
|
||||
} else {
|
||||
|
@ -100,6 +100,7 @@ std::string active_environment();
|
||||
enum ArgumentType {
|
||||
required,
|
||||
verbatim,
|
||||
item,
|
||||
optional
|
||||
};
|
||||
|
||||
|
@ -585,6 +585,15 @@ void parse_arguments(string const & command,
|
||||
parse_text(p, os, FLAG_ITEM, outer, context);
|
||||
ert = "}";
|
||||
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:
|
||||
// This argument may contain special characters
|
||||
ert += '{' + p.verbatim_item() + '}';
|
||||
|
Loading…
Reference in New Issue
Block a user