- InsetCommand::read(buf, lex);
- lyxerr[Debug::INSETS] << "FloatList::float_type: " << getCmdName() << endl;
- if (!buf.params().getLyXTextClass().floats().typeExist(getCmdName()))
- lex.printError("InsetFloatList: Unknown float type: `$$Token'");
+ FloatList const & floats = buf.params().getLyXTextClass().floats();
+ string token;
+
+ if (lex.eatLine()) {
+ setParam("type", lex.getDocString());
+ lyxerr[Debug::INSETS] << "FloatList::float_type: "
+ << to_ascii(getParam("type")) << endl;
+ if (!floats.typeExist(to_ascii(getParam("type"))))
+ lex.printError("InsetFloatList: Unknown float type: `$$Token'");
+ } else
+ lex.printError("InsetFloatList: Parse error: `$$Token'");
+ while (lex.isOK()) {
+ lex.next();
+ token = lex.getString();
+ if (token == "\\end_inset")
+ break;
+ }
+ if (token != "\\end_inset") {
+ lex.printError("Missing \\end_inset at this point. "
+ "Read: `$$Token'");
+ }