Changeset View
Changeset View
Standalone View
Standalone View
llvm/trunk/tools/llvm-rc/ResourceScriptParser.cpp
Show First 20 Lines • Show All 323 Lines • ▼ Show 20 Lines | |||||
Expected<Control> RCParser::parseControl() { | Expected<Control> RCParser::parseControl() { | ||||
// Each control definition (except CONTROL) follows one of the schemes below | // Each control definition (except CONTROL) follows one of the schemes below | ||||
// depending on the control class: | // depending on the control class: | ||||
// [class] text, id, x, y, width, height [, style] [, exstyle] [, helpID] | // [class] text, id, x, y, width, height [, style] [, exstyle] [, helpID] | ||||
// [class] id, x, y, width, height [, style] [, exstyle] [, helpID] | // [class] id, x, y, width, height [, style] [, exstyle] [, helpID] | ||||
// Note that control ids must be integers. | // Note that control ids must be integers. | ||||
ASSIGN_OR_RETURN(ClassResult, readIdentifier()); | ASSIGN_OR_RETURN(ClassResult, readIdentifier()); | ||||
StringRef ClassUpper = ClassResult->upper(); | std::string ClassUpper = ClassResult->upper(); | ||||
if (Control::SupportedCtls.find(ClassUpper) == Control::SupportedCtls.end()) | if (Control::SupportedCtls.find(ClassUpper) == Control::SupportedCtls.end()) | ||||
return getExpectedError("control type, END or '}'", true); | return getExpectedError("control type, END or '}'", true); | ||||
// Read caption if necessary. | // Read caption if necessary. | ||||
StringRef Caption; | StringRef Caption; | ||||
if (Control::CtlsWithTitle.find(ClassUpper) != Control::CtlsWithTitle.end()) { | if (Control::CtlsWithTitle.find(ClassUpper) != Control::CtlsWithTitle.end()) { | ||||
ASSIGN_OR_RETURN(CaptionResult, readString()); | ASSIGN_OR_RETURN(CaptionResult, readString()); | ||||
RETURN_IF_ERROR(consumeType(Kind::Comma)); | RETURN_IF_ERROR(consumeType(Kind::Comma)); | ||||
▲ Show 20 Lines • Show All 147 Lines • Show Last 20 Lines |