Added support for 'debugger' as a statement. (Rob made me)

This commit is contained in:
rogerl%netscape.com 2000-06-23 00:08:10 +00:00
Родитель 91bedcd0ff
Коммит 1a2c265dd0
4 изменённых файлов: 34 добавлений и 2 удалений

Просмотреть файл

@ -1727,6 +1727,11 @@ void JS::ExprStmtNode::print(PrettyPrinter &f, bool noSemi) const
}
}
void JS::DebuggerStmtNode::print(PrettyPrinter &f, bool) const
{
f << "debugger;";
}
void JS::BlockStmtNode::print(PrettyPrinter &f, bool) const
{
PrettyPrinter::Block b(f, 0);
@ -3270,6 +3275,10 @@ JS::StmtNode *JS::Parser::parseStatement(bool topLevel, bool inSwitch, Semicolon
s = parseTry(pos);
break;
case Token::Debugger:
s = new(arena) DebuggerStmtNode(pos, StmtNode::Debugger);
break;
case Token::Final:
case Token::Static:
case Token::Volatile:

Просмотреть файл

@ -719,7 +719,8 @@ namespace JavaScript {
Interface, // ClassStmtNode <attributes> interface <name> extends <supers> <body>
Namespace, // NamespaceStmtNode <attributes> namespace <name> extends <supers>
Language, // LanguageStmtNode language <language> ;
Package // PackageStmtNode package <packageName> <body>
Package, // PackageStmtNode package <packageName> <body>
Debugger // ExprStmtNode debugger ;
};
private:
@ -748,6 +749,12 @@ namespace JavaScript {
void print(PrettyPrinter &f, bool noSemi) const;
};
struct DebuggerStmtNode: StmtNode {
DebuggerStmtNode(uint32 pos, Kind kind): StmtNode(pos, kind) {}
void print(PrettyPrinter &f, bool noSemi) const;
};
struct IdentifierList: ArenaObject {
IdentifierList *next; // Next identifier in linked list
const StringAtom &name; // The identifier

Просмотреть файл

@ -1727,6 +1727,11 @@ void JS::ExprStmtNode::print(PrettyPrinter &f, bool noSemi) const
}
}
void JS::DebuggerStmtNode::print(PrettyPrinter &f, bool) const
{
f << "debugger;";
}
void JS::BlockStmtNode::print(PrettyPrinter &f, bool) const
{
PrettyPrinter::Block b(f, 0);
@ -3270,6 +3275,10 @@ JS::StmtNode *JS::Parser::parseStatement(bool topLevel, bool inSwitch, Semicolon
s = parseTry(pos);
break;
case Token::Debugger:
s = new(arena) DebuggerStmtNode(pos, StmtNode::Debugger);
break;
case Token::Final:
case Token::Static:
case Token::Volatile:

Просмотреть файл

@ -719,7 +719,8 @@ namespace JavaScript {
Interface, // ClassStmtNode <attributes> interface <name> extends <supers> <body>
Namespace, // NamespaceStmtNode <attributes> namespace <name> extends <supers>
Language, // LanguageStmtNode language <language> ;
Package // PackageStmtNode package <packageName> <body>
Package, // PackageStmtNode package <packageName> <body>
Debugger // ExprStmtNode debugger ;
};
private:
@ -748,6 +749,12 @@ namespace JavaScript {
void print(PrettyPrinter &f, bool noSemi) const;
};
struct DebuggerStmtNode: StmtNode {
DebuggerStmtNode(uint32 pos, Kind kind): StmtNode(pos, kind) {}
void print(PrettyPrinter &f, bool noSemi) const;
};
struct IdentifierList: ArenaObject {
IdentifierList *next; // Next identifier in linked list
const StringAtom &name; // The identifier