Add support for Set statements without {}'s. Now we can just say

set Foo = bar in
  def blah: blahclass {}


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7355 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2003-07-28 03:49:40 +00:00
parent ce3d64025b
commit 2e724541ff
2 changed files with 28 additions and 14 deletions

View File

@ -438,11 +438,18 @@ DefInst : DEF ObjectBody {
Object : ClassInst | DefInst; Object : ClassInst | DefInst;
// Support Set commands wrapping objects... // SETCommand - A 'SET' statement start...
Object : SET ID OptBitList '=' Value IN { SETCommand : SET ID OptBitList '=' Value IN {
SetStack.push_back(std::make_pair(std::make_pair(*$2, $3), $5)); SetStack.push_back(std::make_pair(std::make_pair(*$2, $3), $5));
delete $2; delete $2;
} '{' ObjectList '}' { };
// Support Set commands wrapping objects... both with and without braces.
Object : SETCommand '{' ObjectList '}' {
delete SetStack.back().first.second; // Delete OptBitList
SetStack.pop_back();
}
| SETCommand Object {
delete SetStack.back().first.second; // Delete OptBitList delete SetStack.back().first.second; // Delete OptBitList
SetStack.pop_back(); SetStack.pop_back();
}; };

View File

@ -438,11 +438,18 @@ DefInst : DEF ObjectBody {
Object : ClassInst | DefInst; Object : ClassInst | DefInst;
// Support Set commands wrapping objects... // SETCommand - A 'SET' statement start...
Object : SET ID OptBitList '=' Value IN { SETCommand : SET ID OptBitList '=' Value IN {
SetStack.push_back(std::make_pair(std::make_pair(*$2, $3), $5)); SetStack.push_back(std::make_pair(std::make_pair(*$2, $3), $5));
delete $2; delete $2;
} '{' ObjectList '}' { };
// Support Set commands wrapping objects... both with and without braces.
Object : SETCommand '{' ObjectList '}' {
delete SetStack.back().first.second; // Delete OptBitList
SetStack.pop_back();
}
| SETCommand Object {
delete SetStack.back().first.second; // Delete OptBitList delete SetStack.back().first.second; // Delete OptBitList
SetStack.pop_back(); SetStack.pop_back();
}; };