Skip to content

Commit

Permalink
drop using static from stages 0 and 1
Browse files Browse the repository at this point in the history
  • Loading branch information
NotFound committed Apr 29, 2012
1 parent 650fdfe commit 4006a0b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 64 deletions.
31 changes: 0 additions & 31 deletions winxedst0.cpp
Expand Up @@ -1301,34 +1301,6 @@ ExternStatement::ExternStatement(Tokenizer &tk)

//**********************************************************************

class StaticStatement : public BaseStatement
{
public:
StaticStatement(Block &bl, Tokenizer &tk)
{
Token t;
do {
t = tk.get();
std::string name = t.identifier();
names.push_back(name);
bl.genlocal(name, REGvar);
} while ((t= tk.get()).isop(','));
RequireOp(';', t);
}
private:
void emit (Emit &e)
{
for (size_t i= 0; i < names.size(); ++i) {
std::string name = names[i];
e << ".const 'Sub' " << name << " = '" << name << "'\n";
}
}

std::vector<std::string> names;
};

//**********************************************************************

class Expr : public InBlock
{
public:
Expand Down Expand Up @@ -2141,9 +2113,6 @@ BaseStatement *parseUsing(Block &block, Tokenizer &tk)
{
return new ExternStatement(tk);
}
else if (t.iskeyword("static")) {
return new StaticStatement(block, tk);
}
else
{
NamespaceKey ns;
Expand Down
33 changes: 0 additions & 33 deletions winxedst1.winxed
Expand Up @@ -2310,8 +2310,6 @@ function parseUsing(t, tk, owner)
switch {
case taux.iskeyword('extern'):
return new ExternStatement(t, tk, owner);
case taux.iskeyword('static'):
return new StaticStatement(t, tk, owner);
case taux.iskeyword('namespace'):
return new UsingNamespaceStatement(taux, tk, owner);
default:
Expand Down Expand Up @@ -2588,37 +2586,6 @@ class ExternStatement : Statement
}
}

//*********************************************
// StaticStatement
//*********************************************

class StaticStatement : Statement
{
var names;
function StaticStatement(start, tk, owner)
{
self.Statement(start, owner);
var names = parseList(tk, null, parseIdentifier, ';');
for (var name in names) {
string id = self.generatesubid();
self.createvarnamed(name, REGvar, id);
}
self.names = names;
}
function optimize()
{
return self;
}
function emit(e)
{
self.annotate(e);
for (var name in self.names) {
var v = self.getvar(name);
e.say(".const 'Sub' ", v.getreg(), " = '", name, "'");
}
}
}

//*********************************************
// UsingStatement
//*********************************************
Expand Down

0 comments on commit 4006a0b

Please sign in to comment.