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:
Georg Baum 2010-12-27 20:15:24 +00:00
parent 8f037c8e91
commit 84be0a0db4
4 changed files with 13 additions and 1 deletions

View File

@ -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{}

View File

@ -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 {

View File

@ -100,6 +100,7 @@ std::string active_environment();
enum ArgumentType { enum ArgumentType {
required, required,
verbatim, verbatim,
item,
optional optional
}; };

View File

@ -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() + '}';