mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-21 06:45:39 -06:00
cpp: C++11 completed
git-svn-id: svn://ultimatepp.org/upp/trunk@8750 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
da0f20eb31
commit
27c0c297d5
2 changed files with 58 additions and 28 deletions
|
|
@ -1102,6 +1102,18 @@ Array<Parser::Decl> Parser::Declaration(bool l0, bool more, const String& tname,
|
||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
const char *b = lex.Pos();
|
||||||
|
if(Key(tk_using) && lex.IsId()) {
|
||||||
|
String name = lex.GetId();
|
||||||
|
Key('=');
|
||||||
|
Array<Decl> r;
|
||||||
|
Decl& d = r.Add();
|
||||||
|
ReadType(d, tname, tparam);
|
||||||
|
d.name = name;
|
||||||
|
d.natural = String(b, lex.Pos());
|
||||||
|
d.type_def = true;
|
||||||
|
return r;
|
||||||
|
}
|
||||||
return Declaration0(l0, more, tname, tparam);
|
return Declaration0(l0, more, tname, tparam);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1420,7 +1432,8 @@ void Parser::Enum()
|
||||||
|
|
||||||
bool Parser::UsingNamespace()
|
bool Parser::UsingNamespace()
|
||||||
{
|
{
|
||||||
if(Key(tk_using)) {
|
if(lex == tk_using && !(lex.IsId(1) && lex[2] == '=')) {
|
||||||
|
++lex;
|
||||||
if(Key(tk_namespace))
|
if(Key(tk_namespace))
|
||||||
while(lex.IsId()) {
|
while(lex.IsId()) {
|
||||||
Vector<String> h = Split(context.namespace_using, ';');
|
Vector<String> h = Split(context.namespace_using, ';');
|
||||||
|
|
@ -1530,30 +1543,47 @@ void Parser::Do()
|
||||||
else {
|
else {
|
||||||
String tnames;
|
String tnames;
|
||||||
String tparam = TemplateParams(tnames);
|
String tparam = TemplateParams(tnames);
|
||||||
if(!Scope(tparam, tnames)) {
|
if(lex == tk_using) { //C++11 template alias template <...> using ID =
|
||||||
Array<Decl> r = Declaration(true, true, tnames, tparam);
|
Array<Decl> r = Declaration(true, true, tnames, tparam);
|
||||||
CppItem *functionItem = 0;
|
|
||||||
bool body = lex == '{';
|
|
||||||
for(int i = 0; i < r.GetCount(); i++) {
|
for(int i = 0; i < r.GetCount(); i++) {
|
||||||
Decl& d = r[i];
|
Decla& d = r[i];
|
||||||
if(!d.isfriend && d.function) {
|
if(d.type_def) {
|
||||||
CppItem& m = Fn(d, "template " + tparam + ' ', body, tnames, tparam);
|
String scope = context.scope;
|
||||||
functionItem = &m;
|
ScopeCat(scope, d.name);
|
||||||
|
CppItem& im = Item(scope, context.namespace_using, "typedef", d.name);
|
||||||
|
im.natural = Purify(d.natural);
|
||||||
|
im.type = d.type;
|
||||||
|
im.access = context.access;
|
||||||
|
im.kind = TYPEDEF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(body && functionItem && whenFnEnd) {
|
}
|
||||||
symbolsOutsideFunctions.Merge( lex.FinishStatCollection() );
|
else {
|
||||||
lex.StartStatCollection(); // start collection of function symbols
|
if(!Scope(tparam, tnames)) {
|
||||||
|
Array<Decl> r = Declaration(true, true, tnames, tparam);
|
||||||
|
CppItem *functionItem = 0;
|
||||||
|
bool body = lex == '{';
|
||||||
|
for(int i = 0; i < r.GetCount(); i++) {
|
||||||
|
Decl& d = r[i];
|
||||||
|
if(!d.isfriend && d.function) {
|
||||||
|
CppItem& m = Fn(d, "template " + tparam + ' ', body, tnames, tparam);
|
||||||
|
functionItem = &m;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(body && functionItem && whenFnEnd) {
|
||||||
|
symbolsOutsideFunctions.Merge( lex.FinishStatCollection() );
|
||||||
|
lex.StartStatCollection(); // start collection of function symbols
|
||||||
|
}
|
||||||
|
EatBody();
|
||||||
|
if(body && functionItem && whenFnEnd) {
|
||||||
|
whenFnEnd(FunctionStat(current_scope, *functionItem,
|
||||||
|
lex.FinishStatCollection(), maxScopeDepth));
|
||||||
|
lex.StartStatCollection(); // start collection of orphan symbols
|
||||||
|
}
|
||||||
|
Key(';');
|
||||||
}
|
}
|
||||||
EatBody();
|
EatBody();
|
||||||
if(body && functionItem && whenFnEnd) {
|
|
||||||
whenFnEnd(FunctionStat(current_scope, *functionItem,
|
|
||||||
lex.FinishStatCollection(), maxScopeDepth));
|
|
||||||
lex.StartStatCollection(); // start collection of orphan symbols
|
|
||||||
}
|
|
||||||
Key(';');
|
|
||||||
}
|
}
|
||||||
EatBody();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -53,21 +53,21 @@ LAYOUT(CustomLayout, 608, 410)
|
||||||
ITEM(Button, exit, SetLabel(t_("Close")).RightPosZ(4, 80).BottomPosZ(4, 22))
|
ITEM(Button, exit, SetLabel(t_("Close")).RightPosZ(4, 80).BottomPosZ(4, 22))
|
||||||
END_LAYOUT
|
END_LAYOUT
|
||||||
|
|
||||||
LAYOUT(RunLayout, 420, 172)
|
LAYOUT(RunLayout, 440, 172)
|
||||||
ITEM(Label, dv___0, SetLabel(t_("&Program arguments:")).LeftPosZ(4, 112).TopPosZ(4, 19))
|
ITEM(Label, dv___0, SetLabel(t_("&Program arguments:")).LeftPosZ(4, 112).TopPosZ(4, 19))
|
||||||
ITEM(WithDropChoice<EditString>, arg, HSizePosZ(120, 4).TopPosZ(4, 19))
|
ITEM(WithDropChoice<EditString>, arg, HSizePosZ(120, 8).TopPosZ(4, 19))
|
||||||
ITEM(Label, dv___2, SetLabel(t_("&Working directory:")).LeftPosZ(4, 112).TopPosZ(28, 19))
|
ITEM(Label, dv___2, SetLabel(t_("&Working directory:")).LeftPosZ(4, 112).TopPosZ(28, 19))
|
||||||
ITEM(EditString, dir, HSizePosZ(120, 4).TopPosZ(28, 19))
|
ITEM(EditString, dir, HSizePosZ(120, 8).TopPosZ(28, 19))
|
||||||
ITEM(Label, stdout_file_lbl, SetLabel(t_("STDOUT file:")).LeftPosZ(4, 112).TopPosZ(52, 19))
|
ITEM(Label, stdout_file_lbl, SetLabel(t_("STDOUT file:")).LeftPosZ(4, 112).TopPosZ(52, 19))
|
||||||
ITEM(WithDropChoice<EditString>, stdout_file, HSizePosZ(120, 4).TopPosZ(52, 19))
|
ITEM(WithDropChoice<EditString>, stdout_file, HSizePosZ(120, 8).TopPosZ(52, 19))
|
||||||
ITEM(Label, dv___6, SetLabel(t_("Standard output:")).LeftPosZ(4, 112).TopPosZ(76, 19))
|
ITEM(Label, dv___6, SetLabel(t_("Standard output:")).LeftPosZ(4, 112).TopPosZ(76, 19))
|
||||||
ITEM(Switch, runmode, SetLabel(t_("&Standalone\n&Console\n&File")).HSizePosZ(120, 104).TopPosZ(76, 19))
|
ITEM(Switch, runmode, SetLabel(t_("&Standalone\n&Console\n&File")).HSizePosZ(120, 112).TopPosZ(76, 19))
|
||||||
ITEM(Option, external, SetLabel(t_("&External application")).HSizePosZ(120, 168).TopPosZ(96, 15))
|
ITEM(Option, external, SetLabel(t_("&External application")).HSizePosZ(120, 112).TopPosZ(96, 15))
|
||||||
ITEM(Switch, consolemode, SetLabel(t_("Auto\nAlways\nNever")).HSizePosZ(120, 4).TopPosZ(116, 20))
|
ITEM(Switch, consolemode, SetLabel(t_("Auto\nAlways\nNever")).HSizePosZ(120, 24).TopPosZ(116, 20))
|
||||||
ITEM(Button, ok, SetLabel(t_("OK")).RightPosZ(72, 64).BottomPosZ(8, 24))
|
ITEM(Button, ok, SetLabel(t_("OK")).RightPosZ(76, 64).BottomPosZ(8, 24))
|
||||||
ITEM(Button, cancel, SetLabel(t_("Cancel")).RightPosZ(4, 64).BottomPosZ(8, 24))
|
ITEM(Button, cancel, SetLabel(t_("Cancel")).RightPosZ(8, 64).BottomPosZ(8, 24))
|
||||||
ITEM(Label, console_lable, SetLabel(t_("Open console:")).LeftPosZ(4, 112).TopPosZ(116, 20))
|
ITEM(Label, console_lable, SetLabel(t_("Open console:")).LeftPosZ(4, 112).TopPosZ(116, 20))
|
||||||
ITEM(Option, utf8, SetLabel(t_("Output is UTF-8")).LeftPosZ(316, 104).TopPosZ(76, 20))
|
ITEM(Option, utf8, SetLabel(t_("Output is UTF-8")).LeftPosZ(328, 112).TopPosZ(76, 20))
|
||||||
END_LAYOUT
|
END_LAYOUT
|
||||||
|
|
||||||
LAYOUT(FindInFilesLayout, 568, 152)
|
LAYOUT(FindInFilesLayout, 568, 152)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue