Commit 880105d6 authored by darin's avatar darin

JavaScriptCore:

	- a first step towards atomic identifiers in JavaScript

	Most places that work with identifiers now use Identifier
	instead of UString.

        * kjs/identifier.cpp: Added.
        * kjs/identifier.h: Added.
        * JavaScriptCore.pbproj/project.pbxproj: Added files.

        * kjs/array_object.cpp:
        * kjs/array_object.h:
        * kjs/completion.cpp:
        * kjs/completion.h:
        * kjs/date_object.cpp:
        * kjs/date_object.h:
        * kjs/function.cpp:
        * kjs/function.h:
        * kjs/function_object.cpp:
        * kjs/grammar.cpp:
        * kjs/grammar.cpp.h:
        * kjs/grammar.h:
        * kjs/grammar.y:
        * kjs/internal.cpp:
        * kjs/internal.h:
        * kjs/lexer.cpp:
        * kjs/lookup.cpp:
        * kjs/lookup.h:
        * kjs/math_object.cpp:
        * kjs/math_object.h:
        * kjs/nodes.cpp:
        * kjs/nodes.h:
        * kjs/number_object.cpp:
        * kjs/number_object.h:
        * kjs/object.cpp:
        * kjs/object.h:
        * kjs/property_map.cpp:
        * kjs/property_map.h:
        * kjs/reference.cpp:
        * kjs/reference.h:
        * kjs/regexp_object.cpp:
        * kjs/regexp_object.h:
        * kjs/string_object.cpp:
        * kjs/string_object.h:

WebCore:

	- a first step towards atomic identifiers in JavaScript

	Most places that work with identifiers now use Identifier
	instead of UString.

        * khtml/ecma/kjs_binding.cpp:
        * khtml/ecma/kjs_binding.h:
        * khtml/ecma/kjs_css.cpp:
        * khtml/ecma/kjs_css.h:
        * khtml/ecma/kjs_dom.cpp:
        * khtml/ecma/kjs_dom.h:
        * khtml/ecma/kjs_events.cpp:
        * khtml/ecma/kjs_events.h:
        * khtml/ecma/kjs_html.cpp:
        * khtml/ecma/kjs_html.h:
        * khtml/ecma/kjs_navigator.cpp:
        * khtml/ecma/kjs_navigator.h:
        * khtml/ecma/kjs_range.cpp:
        * khtml/ecma/kjs_range.h:
        * khtml/ecma/kjs_traversal.cpp:
        * khtml/ecma/kjs_traversal.h:
        * khtml/ecma/kjs_views.cpp:
        * khtml/ecma/kjs_views.h:
        * khtml/ecma/kjs_window.cpp:
        * khtml/ecma/kjs_window.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2760 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 914b6e5d
2002-11-19 Darin Adler <darin@apple.com>
- a first step towards atomic identifiers in JavaScript
Most places that work with identifiers now use Identifier
instead of UString.
* kjs/identifier.cpp: Added.
* kjs/identifier.h: Added.
* JavaScriptCore.pbproj/project.pbxproj: Added files.
* kjs/array_object.cpp:
* kjs/array_object.h:
* kjs/completion.cpp:
* kjs/completion.h:
* kjs/date_object.cpp:
* kjs/date_object.h:
* kjs/function.cpp:
* kjs/function.h:
* kjs/function_object.cpp:
* kjs/grammar.cpp:
* kjs/grammar.cpp.h:
* kjs/grammar.h:
* kjs/grammar.y:
* kjs/internal.cpp:
* kjs/internal.h:
* kjs/lexer.cpp:
* kjs/lookup.cpp:
* kjs/lookup.h:
* kjs/math_object.cpp:
* kjs/math_object.h:
* kjs/nodes.cpp:
* kjs/nodes.h:
* kjs/number_object.cpp:
* kjs/number_object.h:
* kjs/object.cpp:
* kjs/object.h:
* kjs/property_map.cpp:
* kjs/property_map.h:
* kjs/reference.cpp:
* kjs/reference.h:
* kjs/regexp_object.cpp:
* kjs/regexp_object.h:
* kjs/string_object.cpp:
* kjs/string_object.h:
2002-11-19 Darin Adler <darin@apple.com>
- fix hash function and key comparison for the other kind of hash table; yields 3%
......
2002-11-19 Darin Adler <darin@apple.com>
- a first step towards atomic identifiers in JavaScript
Most places that work with identifiers now use Identifier
instead of UString.
* kjs/identifier.cpp: Added.
* kjs/identifier.h: Added.
* JavaScriptCore.pbproj/project.pbxproj: Added files.
* kjs/array_object.cpp:
* kjs/array_object.h:
* kjs/completion.cpp:
* kjs/completion.h:
* kjs/date_object.cpp:
* kjs/date_object.h:
* kjs/function.cpp:
* kjs/function.h:
* kjs/function_object.cpp:
* kjs/grammar.cpp:
* kjs/grammar.cpp.h:
* kjs/grammar.h:
* kjs/grammar.y:
* kjs/internal.cpp:
* kjs/internal.h:
* kjs/lexer.cpp:
* kjs/lookup.cpp:
* kjs/lookup.h:
* kjs/math_object.cpp:
* kjs/math_object.h:
* kjs/nodes.cpp:
* kjs/nodes.h:
* kjs/number_object.cpp:
* kjs/number_object.h:
* kjs/object.cpp:
* kjs/object.h:
* kjs/property_map.cpp:
* kjs/property_map.h:
* kjs/reference.cpp:
* kjs/reference.h:
* kjs/regexp_object.cpp:
* kjs/regexp_object.h:
* kjs/string_object.cpp:
* kjs/string_object.h:
2002-11-19 Darin Adler <darin@apple.com>
- fix hash function and key comparison for the other kind of hash table; yields 3%
......
2002-11-19 Darin Adler <darin@apple.com>
- a first step towards atomic identifiers in JavaScript
Most places that work with identifiers now use Identifier
instead of UString.
* kjs/identifier.cpp: Added.
* kjs/identifier.h: Added.
* JavaScriptCore.pbproj/project.pbxproj: Added files.
* kjs/array_object.cpp:
* kjs/array_object.h:
* kjs/completion.cpp:
* kjs/completion.h:
* kjs/date_object.cpp:
* kjs/date_object.h:
* kjs/function.cpp:
* kjs/function.h:
* kjs/function_object.cpp:
* kjs/grammar.cpp:
* kjs/grammar.cpp.h:
* kjs/grammar.h:
* kjs/grammar.y:
* kjs/internal.cpp:
* kjs/internal.h:
* kjs/lexer.cpp:
* kjs/lookup.cpp:
* kjs/lookup.h:
* kjs/math_object.cpp:
* kjs/math_object.h:
* kjs/nodes.cpp:
* kjs/nodes.h:
* kjs/number_object.cpp:
* kjs/number_object.h:
* kjs/object.cpp:
* kjs/object.h:
* kjs/property_map.cpp:
* kjs/property_map.h:
* kjs/reference.cpp:
* kjs/reference.h:
* kjs/regexp_object.cpp:
* kjs/regexp_object.h:
* kjs/string_object.cpp:
* kjs/string_object.h:
2002-11-19 Darin Adler <darin@apple.com>
- fix hash function and key comparison for the other kind of hash table; yields 3%
......
......@@ -222,6 +222,7 @@
F54F0801030CD22001B5C2EB,
F5341393030CEEB1018BE7F3,
F5BB2BC7030F772101FCFE1D,
933A349C038AE7C6008635CE,
);
isa = PBXHeadersBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
......@@ -267,6 +268,7 @@
F5341392030CEEB1018BE7F3,
F5341395030CF5F8018BE7F3,
F5BB2BC6030F772101FCFE1D,
933A349E038AE80F008635CE,
);
isa = PBXSourcesBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
......@@ -336,16 +338,12 @@
F692A85D0255597D01FF60F7,
F692A85E0255597D01FF60F7,
F692A85F0255597D01FF60F7,
F692A8C802555BA201FF60F7,
F692A8C902555BA201FF60F7,
F692A8CA02555BA201FF60F7,
933A349A038AE7C6008635CE,
933A349D038AE80F008635CE,
F692A8610255597D01FF60F7,
F692A8620255597D01FF60F7,
F692A8630255597D01FF60F7,
F692A8640255597D01FF60F7,
F692A8650255597D01FF60F7,
F692A8660255597D01FF60F7,
F692A8670255597D01FF60F7,
F692A8680255597D01FF60F7,
F692A8690255597D01FF60F7,
F692A86A0255597D01FF60F7,
......@@ -432,6 +430,52 @@
//102
//103
//104
//930
//931
//932
//933
//934
933A3499038AE7C6008635CE = {
fileEncoding = 4;
isa = PBXFileReference;
name = grammar.y;
path = kjs/grammar.y;
refType = 4;
};
933A349A038AE7C6008635CE = {
fileEncoding = 4;
isa = PBXFileReference;
name = identifier.h;
path = kjs/identifier.h;
refType = 4;
};
933A349C038AE7C6008635CE = {
fileRef = 933A349A038AE7C6008635CE;
isa = PBXBuildFile;
settings = {
ATTRIBUTES = (
Private,
);
};
};
933A349D038AE80F008635CE = {
fileEncoding = 4;
isa = PBXFileReference;
name = identifier.cpp;
path = kjs/identifier.cpp;
refType = 4;
};
933A349E038AE80F008635CE = {
fileRef = 933A349D038AE80F008635CE;
isa = PBXBuildFile;
settings = {
};
};
//930
//931
//932
//933
//934
//F50
//F51
//F52
......@@ -575,6 +619,13 @@
F5C290E50284F960018635CA = {
children = (
F692A8540255597D01FF60F7,
F692A8C802555BA201FF60F7,
F692A8C902555BA201FF60F7,
F692A8CA02555BA201FF60F7,
933A3499038AE7C6008635CE,
F692A8650255597D01FF60F7,
F692A8660255597D01FF60F7,
F692A8670255597D01FF60F7,
F68EBB8C0255D4C601FF60F7,
F5C290E60284F98E018635CA,
);
......
......@@ -65,7 +65,7 @@ ArrayInstanceImp::~ArrayInstanceImp()
free(storage);
}
Value ArrayInstanceImp::get(ExecState *exec, const UString &propertyName) const
Value ArrayInstanceImp::get(ExecState *exec, const Identifier &propertyName) const
{
if (propertyName == lengthPropertyName)
return Number(length);
......@@ -91,7 +91,7 @@ Value ArrayInstanceImp::get(ExecState *exec, unsigned index) const
}
// Special implementation of [[Put]] - see ECMA 15.4.5.1
void ArrayInstanceImp::put(ExecState *exec, const UString &propertyName, const Value &value, int attr)
void ArrayInstanceImp::put(ExecState *exec, const Identifier &propertyName, const Value &value, int attr)
{
if (propertyName == lengthPropertyName) {
setLength(value.toUInt32(exec));
......@@ -117,7 +117,7 @@ void ArrayInstanceImp::put(ExecState *exec, unsigned index, const Value &value,
storage[index] = value.imp();
}
bool ArrayInstanceImp::hasProperty(ExecState *exec, const UString &propertyName) const
bool ArrayInstanceImp::hasProperty(ExecState *exec, const Identifier &propertyName) const
{
if (propertyName == lengthPropertyName)
return true;
......@@ -142,7 +142,7 @@ bool ArrayInstanceImp::hasProperty(ExecState *exec, unsigned index) const
return v && v != UndefinedImp::staticUndefined;
}
bool ArrayInstanceImp::deleteProperty(ExecState *exec, const UString &propertyName)
bool ArrayInstanceImp::deleteProperty(ExecState *exec, const Identifier &propertyName)
{
if (propertyName == lengthPropertyName)
return false;
......@@ -293,7 +293,7 @@ ArrayPrototypeImp::ArrayPrototypeImp(ExecState *exec,
setInternalValue(Null());
}
Value ArrayPrototypeImp::get(ExecState *exec, const UString &propertyName) const
Value ArrayPrototypeImp::get(ExecState *exec, const Identifier &propertyName) const
{
//fprintf( stderr, "ArrayPrototypeImp::get(%s)\n", propertyName.ascii() );
return lookupGetFunction<ArrayProtoFuncImp, ArrayInstanceImp>( exec, propertyName, &arrayTable, this );
......
......@@ -33,13 +33,13 @@ namespace KJS {
ArrayInstanceImp(const Object &proto, const List &initialValues);
~ArrayInstanceImp();
virtual Value get(ExecState *exec, const UString &propertyName) const;
virtual Value get(ExecState *exec, const Identifier &propertyName) const;
virtual Value get(ExecState *exec, unsigned propertyName) const;
virtual void put(ExecState *exec, const UString &propertyName, const Value &value, int attr = None);
virtual void put(ExecState *exec, const Identifier &propertyName, const Value &value, int attr = None);
virtual void put(ExecState *exec, unsigned propertyName, const Value &value, int attr = None);
virtual bool hasProperty(ExecState *exec, const UString &propertyName) const;
virtual bool hasProperty(ExecState *exec, const Identifier &propertyName) const;
virtual bool hasProperty(ExecState *exec, unsigned propertyName) const;
virtual bool deleteProperty(ExecState *exec, const UString &propertyName);
virtual bool deleteProperty(ExecState *exec, const Identifier &propertyName);
virtual bool deleteProperty(ExecState *exec, unsigned propertyName);
virtual void mark();
......@@ -66,7 +66,7 @@ namespace KJS {
public:
ArrayPrototypeImp(ExecState *exec,
ObjectPrototypeImp *objProto);
Value get(ExecState *exec, const UString &p) const;
Value get(ExecState *exec, const Identifier &p) const;
virtual const ClassInfo *classInfo() const { return &info; }
static const ClassInfo info;
};
......
......@@ -28,7 +28,7 @@ using namespace KJS;
// ------------------------------ Completion -----------------------------------
Completion::Completion(ComplType c, const Value& v, const UString &t)
Completion::Completion(ComplType c, const Value& v, const Identifier &t)
: comp(c), val(v), tar(t)
{
}
......@@ -25,6 +25,7 @@
#ifndef _KJS_COMPLETION_H_
#define _KJS_COMPLETION_H_
#include "identifier.h"
#include "value.h"
namespace KJS {
......@@ -47,16 +48,16 @@ namespace KJS {
class Completion : private Value {
public:
Completion(ComplType c = Normal, const Value& v = Value(),
const UString &t = UString::null);
const Identifier &t = Identifier::null);
ComplType complType() const { return comp; }
Value value() const { return val; }
UString target() const { return tar; }
Identifier target() const { return tar; }
bool isValueCompletion() const { return !val.isNull(); }
private:
ComplType comp;
Value val;
UString tar;
Identifier tar;
};
}
......
......@@ -278,7 +278,7 @@ DatePrototypeImp::DatePrototypeImp(ExecState *,
// The constructor will be added later, after DateObjectImp has been built
}
Value DatePrototypeImp::get(ExecState *exec, const UString &propertyName) const
Value DatePrototypeImp::get(ExecState *exec, const Identifier &propertyName) const
{
return lookupGetFunction<DateProtoFuncImp, ObjectImp>( exec, propertyName, &dateTable, this );
}
......
......@@ -46,7 +46,7 @@ namespace KJS {
class DatePrototypeImp : public DateInstanceImp {
public:
DatePrototypeImp(ExecState *exec, ObjectPrototypeImp *objectProto);
Value get(ExecState *exec, const UString &p) const;
Value get(ExecState *exec, const Identifier &p) const;
virtual const ClassInfo *classInfo() const { return &info; }
static const ClassInfo info;
};
......
......@@ -45,14 +45,14 @@ const ClassInfo FunctionImp::info = {"Function", &InternalFunctionImp::info, 0,
namespace KJS {
class Parameter {
public:
Parameter(const UString &n) : name(n), next(0L) { }
Parameter(const Identifier &n) : name(n), next(0L) { }
~Parameter() { delete next; }
UString name;
Identifier name;
Parameter *next;
};
};
FunctionImp::FunctionImp(ExecState *exec, const UString &n)
FunctionImp::FunctionImp(ExecState *exec, const Identifier &n)
: InternalFunctionImp(
static_cast<FunctionPrototypeImp*>(exec->interpreter()->builtinFunctionPrototype().imp())
), param(0L), ident(n)
......@@ -157,7 +157,7 @@ Value FunctionImp::call(ExecState *exec, Object &thisObj, const List &args)
return Undefined();
}
void FunctionImp::addParameter(const UString &n)
void FunctionImp::addParameter(const Identifier &n)
{
Parameter **p = &param;
while (*p)
......@@ -225,7 +225,7 @@ void FunctionImp::processVarDecls(ExecState */*exec*/)
// ### is "Function" correct here?
const ClassInfo DeclaredFunctionImp::info = {"Function", &FunctionImp::info, 0, 0};
DeclaredFunctionImp::DeclaredFunctionImp(ExecState *exec, const UString &n,
DeclaredFunctionImp::DeclaredFunctionImp(ExecState *exec, const Identifier &n,
FunctionBodyNode *b, const List &sc)
: FunctionImp(exec,n), body(b)
{
......
......@@ -36,7 +36,7 @@ namespace KJS {
friend class Function;
friend class ActivationImp;
public:
FunctionImp(ExecState *exec, const UString &n = UString::null);
FunctionImp(ExecState *exec, const Identifier &n = Identifier::null);
virtual ~FunctionImp();
virtual void mark();
......@@ -44,19 +44,19 @@ namespace KJS {
virtual bool implementsCall() const;
virtual Value call(ExecState *exec, Object &thisObj, const List &args);
void addParameter(const UString &n);
void addParameter(const Identifier &n);
// parameters in string representation, e.g. (a, b, c)
UString parameterString() const;
virtual CodeType codeType() const = 0;
virtual Completion execute(ExecState *exec) = 0;
UString name() const { return ident; }
Identifier name() const { return ident; }
virtual const ClassInfo *classInfo() const { return &info; }
static const ClassInfo info;
protected:
Parameter *param;
UString ident;
Identifier ident;
private:
void processParameters(ExecState *exec, const List &);
......@@ -65,7 +65,7 @@ namespace KJS {
class DeclaredFunctionImp : public FunctionImp {
public:
DeclaredFunctionImp(ExecState *exec, const UString &n,
DeclaredFunctionImp(ExecState *exec, const Identifier &n,
FunctionBodyNode *b, const List &sc);
~DeclaredFunctionImp();
......
......@@ -235,7 +235,7 @@ Object FunctionObjectImp::construct(ExecState *exec, const List &args)
scopeChain.append(exec->interpreter()->globalObject());
FunctionBodyNode *bodyNode = progNode;
FunctionImp *fimp = new DeclaredFunctionImp(exec, UString::null, bodyNode,
FunctionImp *fimp = new DeclaredFunctionImp(exec, Identifier::null, bodyNode,
scopeChain);
Object ret(fimp); // protect from GC
......
This diff is collapsed.
......@@ -2,6 +2,7 @@ typedef union {
int ival;
double dval;
UString *ustr;
Identifier *ident;
Node *node;
StatementNode *stat;
ParameterNode *param;
......
......@@ -2,6 +2,7 @@ typedef union {
int ival;
double dval;
UString *ustr;
Identifier *ident;
Node *node;
StatementNode *stat;
ParameterNode *param;
......
......@@ -53,6 +53,7 @@ using namespace KJS;
int ival;
double dval;
UString *ustr;
Identifier *ident;
Node *node;
StatementNode *stat;
ParameterNode *param;
......@@ -110,7 +111,7 @@ using namespace KJS;
/* terminal types */
%token <dval> NUMBER
%token <ustr> STRING
%token <ustr> IDENT
%token <ident> IDENT
/* automatically inserted semicolon */
%token AUTOPLUSPLUS AUTOMINUSMINUS
......@@ -173,7 +174,7 @@ Literal:
PrimaryExpr:
THIS { $$ = new ThisNode(); }
| IDENT { $$ = new ResolveNode($1);
| IDENT { $$ = new ResolveNode(*$1);
delete $1; }
| Literal
| ArrayLiteral
......@@ -211,9 +212,8 @@ PropertyNameAndValueList:
;
PropertyName:
IDENT { $$ = new PropertyNode($1);
delete $1; }
| STRING { $$ = new PropertyNode($1); delete $1; }
IDENT { $$ = new PropertyNode(*$1); delete $1; }
| STRING { $$ = new PropertyNode(Identifier(*$1)); delete $1; }
| NUMBER { $$ = new PropertyNode($1); }
;
......@@ -221,8 +221,7 @@ MemberExpr:
PrimaryExpr
| FunctionExpr
| MemberExpr '[' Expr ']' { $$ = new AccessorNode1($1, $3); }
| MemberExpr '.' IDENT { $$ = new AccessorNode2($1, $3);
delete $3; }
| MemberExpr '.' IDENT { $$ = new AccessorNode2($1, *$3); delete $3; }
| NEW MemberExpr Arguments { $$ = new NewExprNode($2, $3); }
;
......@@ -235,7 +234,7 @@ CallExpr:
MemberExpr Arguments { $$ = new FunctionCallNode($1, $2); }
| CallExpr Arguments { $$ = new FunctionCallNode($1, $2); }
| CallExpr '[' Expr ']' { $$ = new AccessorNode1($1, $3); }
| CallExpr '.' IDENT { $$ = new AccessorNode2($1, $3);
| CallExpr '.' IDENT { $$ = new AccessorNode2($1, *$3);
delete $3; }
;
......@@ -428,8 +427,8 @@ VariableDeclarationList:
;
VariableDeclaration:
IDENT { $$ = new VarDeclNode($1, 0); delete $1; }
| IDENT Initializer { $$ = new VarDeclNode($1, $2); delete $1; }
IDENT { $$ = new VarDeclNode(*$1, 0); delete $1; }
| IDENT Initializer { $$ = new VarDeclNode(*$1, $2); delete $1; }
;
Initializer:
......@@ -469,11 +468,11 @@ IterationStatement:
Statement { $$ = new ForInNode($3, $5, $7);
DBG($$,@1,@6); }
| FOR '(' VAR IDENT IN Expr ')'
Statement { $$ = new ForInNode($4,0L,$6,$8);
Statement { $$ = new ForInNode(*$4,0L,$6,$8);
DBG($$,@1,@7);
delete $4; }
| FOR '(' VAR IDENT Initializer IN Expr ')'
Statement { $$ = new ForInNode($4,$5,$7,$9);
Statement { $$ = new ForInNode(*$4,$5,$7,$9);
DBG($$,@1,@8);
delete $4; }
;
......@@ -489,10 +488,10 @@ ContinueStatement:
$$ = new ContinueNode(); DBG($$,@1,@2);
} else
YYABORT; }
| CONTINUE IDENT ';' { $$ = new ContinueNode($2); DBG($$,@1,@3);
| CONTINUE IDENT ';' { $$ = new ContinueNode(*$2); DBG($$,@1,@3);
delete $2; }
| CONTINUE IDENT error { if (automatic()) {
$$ = new ContinueNode($2);DBG($$,@1,@2);
$$ = new ContinueNode(*$2);DBG($$,@1,@2);
delete $2;
} else
YYABORT; }
......@@ -504,10 +503,10 @@ BreakStatement:
$$ = new BreakNode(); DBG($$,@1,@1);
} else
YYABORT; }
| BREAK IDENT ';' { $$ = new BreakNode($2); DBG($$,@1,@3);
| BREAK IDENT ';' { $$ = new BreakNode(*$2); DBG($$,@1,@3);
delete $2; }
| BREAK IDENT error { if (automatic()) {
$$ = new BreakNode($2); DBG($$,@1,@2);
$$ = new BreakNode(*$2); DBG($$,@1,@2);
delete $2;
} else
YYABORT;
......@@ -564,8 +563,8 @@ DefaultClause:
;
LabelledStatement:
IDENT ':' Statement { $3->pushLabel($1);
$$ = new LabelNode($1, $3);
IDENT ':' Statement { $3->pushLabel(*$1);
$$ = new LabelNode(*$1, $3);
delete $1; }
;
......@@ -580,7 +579,7 @@ TryStatement:
;
Catch:
CATCH '(' IDENT ')' Block { $$ = new CatchNode($3, $5); delete $3; }
CATCH '(' IDENT ')' Block { $$ = new CatchNode(*$3, $5); delete $3; }
;
Finally:
......@@ -588,10 +587,10 @@ Finally:
;
FunctionDeclaration:
FUNCTION IDENT '(' ')' FunctionBody { $$ = new FuncDeclNode($2, 0L, $5);
FUNCTION IDENT '(' ')' FunctionBody { $$ = new FuncDeclNode(*$2, 0L, $5);
delete $2; }
| FUNCTION IDENT '(' FormalParameterList ')' FunctionBody
{ $$ = new FuncDeclNode($2, $4, $6);
{ $$ = new FuncDeclNode(*$2, $4, $6);
delete $2; }
FunctionExpr:
......@@ -602,8 +601,8 @@ FunctionExpr:
;
FormalParameterList:
IDENT { $$ = new ParameterNode($1); delete $1; }
| FormalParameterList ',' IDENT { $$ = $1->append($3);
IDENT { $$ = new ParameterNode(*$1); delete $1; }