<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[204404] trunk/Source/WebCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/204404">204404</a></dd>
<dt>Author</dt> <dd>weinig@apple.com</dd>
<dt>Date</dt> <dd>2016-08-11 21:34:30 -0700 (Thu, 11 Aug 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Support WebIDL unions (Part 1)
https://bugs.webkit.org/show_bug.cgi?id=160769
Reviewed by Chris Dumez.
This is the first part of an effort to add support for union types
in our code generators. This change:
- Adds a domType struct to hold the parsed type information. For now, we only
use it temporarily while parsing, and don't expose it to the code generators,
but that will change in a later patch.
- Remove support for scoped identifiers for types. They are not supported by WebIDL.
- Make debugging the parser easier by providing backtraces when asserting.
There should be no observable changes.
* bindings/scripts/IDLParser.pm:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsIDLParserpm">trunk/Source/WebCore/bindings/scripts/IDLParser.pm</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (204403 => 204404)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-08-12 03:38:54 UTC (rev 204403)
+++ trunk/Source/WebCore/ChangeLog        2016-08-12 04:34:30 UTC (rev 204404)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2016-08-11 Sam Weinig <sam@webkit.org>
+
+ Support WebIDL unions (Part 1)
+ https://bugs.webkit.org/show_bug.cgi?id=160769
+
+ Reviewed by Chris Dumez.
+
+ This is the first part of an effort to add support for union types
+ in our code generators. This change:
+ - Adds a domType struct to hold the parsed type information. For now, we only
+ use it temporarily while parsing, and don't expose it to the code generators,
+ but that will change in a later patch.
+ - Remove support for scoped identifiers for types. They are not supported by WebIDL.
+ - Make debugging the parser easier by providing backtraces when asserting.
+
+ There should be no observable changes.
+
+ * bindings/scripts/IDLParser.pm:
+
</ins><span class="cx"> 2016-08-11 Myles C. Maxfield <mmaxfield@apple.com>
</span><span class="cx">
</span><span class="cx"> Migrate from ints to unsigneds when referring to indices into strings
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsIDLParserpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/IDLParser.pm (204403 => 204404)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/IDLParser.pm        2016-08-12 03:38:54 UTC (rev 204403)
+++ trunk/Source/WebCore/bindings/scripts/IDLParser.pm        2016-08-12 04:34:30 UTC (rev 204404)
</span><span class="lines">@@ -23,6 +23,9 @@
</span><span class="cx">
</span><span class="cx"> use strict;
</span><span class="cx">
</span><ins>+use Carp qw<longmess>;
+use Data::Dumper;
+
</ins><span class="cx"> use preprocessor;
</span><span class="cx"> use Class::Struct;
</span><span class="cx">
</span><span class="lines">@@ -74,17 +77,24 @@
</span><span class="cx"> signature => '$', # Attribute signature
</span><span class="cx"> });
</span><span class="cx">
</span><ins>+struct( domType => {
+ name => '$', # Type identifier
+ isNullable => '$', # Is the type Nullable (T?)
+ isUnion => '$', # Is the type a union (T or U)
+ subtypes => '@', # Array of subtypes, only valid if isUnion or sequence
+});
+
</ins><span class="cx"> # Used to represent a map of 'variable name' <-> 'variable type'
</span><span class="cx"> struct( domSignature => {
</span><del>- direction => '$', # Variable direction (in or out)
- name => '$', # Variable name
- type => '$', # Variable type
- specials => '@', # Specials
</del><ins>+ direction => '$', # Variable direction (in or out)
+ name => '$', # Variable name
+ type => '$' , # Variable type
+ specials => '@', # Specials
</ins><span class="cx"> extendedAttributes => '$', # Extended attributes
</span><del>- isNullable => '$', # Is variable type Nullable (T?)
- isVariadic => '$', # Is variable variadic (long... numbers)
- isOptional => '$', # Is variable optional (optional T)
- default => '$', # Default value for parameters
</del><ins>+ isNullable => '$', # Is variable type Nullable (T?)
+ isVariadic => '$', # Is variable variadic (long... numbers)
+ isOptional => '$', # Is variable optional (optional T)
+ default => '$', # Default value for parameters
</ins><span class="cx"> });
</span><span class="cx">
</span><span class="cx"> # Used to represent Iterable interfaces
</span><span class="lines">@@ -96,12 +106,11 @@
</span><span class="cx"> extendedAttributes => '$', # Extended attributes
</span><span class="cx"> });
</span><span class="cx">
</span><del>-
</del><span class="cx"> # Used to represent string constants
</span><span class="cx"> struct( domConstant => {
</span><del>- name => '$', # DOM Constant identifier
- type => '$', # Type of data
- value => '$', # Constant value
</del><ins>+ name => '$', # DOM Constant identifier
+ type => '$', # Type of data
+ value => '$', # Constant value
</ins><span class="cx"> extendedAttributes => '$', # Extended attributes
</span><span class="cx"> });
</span><span class="cx">
</span><span class="lines">@@ -149,6 +158,16 @@
</span><span class="cx"> return bless $self, $class;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+sub assert
+{
+ my $message = shift;
+
+ my $mess = longmess();
+ print Dumper($mess);
+
+ die $message;
+}
+
</ins><span class="cx"> sub assertTokenValue
</span><span class="cx"> {
</span><span class="cx"> my $self = shift;
</span><span class="lines">@@ -155,11 +174,12 @@
</span><span class="cx"> my $token = shift;
</span><span class="cx"> my $value = shift;
</span><span class="cx"> my $line = shift;
</span><del>- my $msg = "Next token should be " . $value . ", but " . $token->value() . " at " . $self->{Line};
</del><ins>+ my $msg = "Next token should be " . $value . ", but " . $token->value() . " on line " . $self->{Line};
</ins><span class="cx"> if (defined ($line)) {
</span><span class="cx"> $msg .= " IDLParser.pm:" . $line;
</span><span class="cx"> }
</span><del>- die $msg unless $token->value() eq $value;
</del><ins>+
+ assert $msg unless $token->value() eq $value;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub assertTokenType
</span><span class="lines">@@ -167,7 +187,8 @@
</span><span class="cx"> my $self = shift;
</span><span class="cx"> my $token = shift;
</span><span class="cx"> my $type = shift;
</span><del>- die "Next token's type should be " . $type . ", but " . $token->type() . " at " . $self->{Line} unless $token->type() eq $type;
</del><ins>+
+ assert "Next token's type should be " . $type . ", but " . $token->type() . " on line " . $self->{Line} unless $token->type() eq $type;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub assertUnexpectedToken
</span><span class="lines">@@ -175,11 +196,12 @@
</span><span class="cx"> my $self = shift;
</span><span class="cx"> my $token = shift;
</span><span class="cx"> my $line = shift;
</span><del>- my $msg = "Unexpected token " . $token . " at " . $self->{Line};
</del><ins>+ my $msg = "Unexpected token " . $token . " on line " . $self->{Line};
</ins><span class="cx"> if (defined ($line)) {
</span><span class="cx"> $msg .= " IDLParser.pm:" . $line;
</span><span class="cx"> }
</span><del>- die $msg;
</del><ins>+
+ assert $msg;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub assertNoExtendedAttributesInTypedef
</span><span class="lines">@@ -188,11 +210,12 @@
</span><span class="cx"> my $name = shift;
</span><span class="cx"> my $line = shift;
</span><span class="cx"> my $typedef = $typedefs{$name};
</span><del>- my $msg = "Unexpected extendedAttributeList in typedef \"$name\" at " . $self->{Line};
</del><ins>+ my $msg = "Unexpected extendedAttributeList in typedef \"$name\" on line " . $self->{Line};
</ins><span class="cx"> if (defined ($line)) {
</span><span class="cx"> $msg .= " IDLParser.pm:" . $line;
</span><span class="cx"> }
</span><del>- die $msg if %{$typedef->extendedAttributes};
</del><ins>+
+ assert $msg if %{$typedef->extendedAttributes};
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub Parse
</span><span class="lines">@@ -216,7 +239,7 @@
</span><span class="cx"> my $next = $self->nextToken();
</span><span class="cx"> $self->assertTokenType($next, EmptyToken);
</span><span class="cx"> };
</span><del>- die $@ . " in $fileName" if $@;
</del><ins>+ assert $@ . " in $fileName" if $@;
</ins><span class="cx">
</span><span class="cx"> my $document = idlDocument->new();
</span><span class="cx"> $document->fileName($fileName);
</span><span class="lines">@@ -253,7 +276,7 @@
</span><span class="cx"> my $integerTokenPattern = '^(-?[1-9][0-9]*|-?0[Xx][0-9A-Fa-f]+|-?0[0-7]*)';
</span><span class="cx"> my $stringTokenPattern = '^(\"[^\"]*\")';
</span><span class="cx"> my $identifierTokenPattern = '^([A-Z_a-z][0-9A-Z_a-z]*)';
</span><del>-my $otherTokenPattern = '^(::|\.\.\.|[^\t\n\r 0-9A-Z_a-z])';
</del><ins>+my $otherTokenPattern = '^(\.\.\.|[^\t\n\r 0-9A-Z_a-z])';
</ins><span class="cx">
</span><span class="cx"> sub getTokenInternal
</span><span class="cx"> {
</span><span class="lines">@@ -318,21 +341,6 @@
</span><span class="cx"> die "Failed to parse string (" . $quotedString . ") at " . $self->{Line};
</span><span class="cx"> }
</span><span class="cx">
</span><del>-sub typeHasNullableSuffix
-{
- my $type = shift;
- return $type ? $type =~ /\?$/ : 0;
-}
-
-sub typeRemoveNullableSuffix
-{
- my $type = shift;
- if ($type) {
- $type =~ s/\?//g;
- }
- return $type;
-}
-
</del><span class="cx"> sub identifierRemoveNullablePrefix
</span><span class="cx"> {
</span><span class="cx"> my $type = shift;
</span><span class="lines">@@ -343,26 +351,26 @@
</span><span class="cx"> my $nextAttribute_1 = '^(attribute|inherit|readonly)$';
</span><span class="cx"> my $nextPrimitiveType_1 = '^(int|long|short|unsigned)$';
</span><span class="cx"> my $nextPrimitiveType_2 = '^(double|float|unrestricted)$';
</span><del>-my $nextArgumentList_1 = '^(\(|::|ByteString|DOMString|USVString|Date|\[|any|boolean|byte|double|float|in|long|object|octet|optional|sequence|short|unrestricted|unsigned)$';
</del><ins>+my $nextArgumentList_1 = '^(\(|ByteString|DOMString|USVString|Date|\[|any|boolean|byte|double|float|in|long|object|octet|optional|sequence|short|unrestricted|unsigned)$';
</ins><span class="cx"> my $nextNonAnyType_1 = '^(boolean|byte|double|float|long|octet|short|unrestricted|unsigned)$';
</span><del>-my $nextInterfaceMember_1 = '^(\(|::|ByteString|DOMString|USVString|Date|any|attribute|boolean|byte|creator|deleter|double|float|getter|inherit|legacycaller|long|object|octet|readonly|sequence|serializer|setter|short|static|stringifier|unrestricted|unsigned|void)$';
</del><ins>+my $nextInterfaceMember_1 = '^(\(|ByteString|DOMString|USVString|Date|any|attribute|boolean|byte|creator|deleter|double|float|getter|inherit|legacycaller|long|object|octet|readonly|sequence|serializer|setter|short|static|stringifier|unrestricted|unsigned|void)$';
</ins><span class="cx"> my $nextAttributeOrOperation_1 = '^(static|stringifier)$';
</span><del>-my $nextAttributeOrOperation_2 = '^(\(|::|ByteString|DOMString|USVString|Date|any|boolean|byte|creator|deleter|double|float|getter|legacycaller|long|object|octet|sequence|setter|short|unrestricted|unsigned|void)$';
</del><ins>+my $nextAttributeOrOperation_2 = '^(\(|ByteString|DOMString|USVString|Date|any|boolean|byte|creator|deleter|double|float|getter|legacycaller|long|object|octet|sequence|setter|short|unrestricted|unsigned|void)$';
</ins><span class="cx"> my $nextUnrestrictedFloatType_1 = '^(double|float)$';
</span><del>-my $nextExtendedAttributeRest3_1 = '^(\,|::|\])$';
-my $nextExceptionField_1 = '^(\(|::|ByteString|DOMString|USVString|Date|any|boolean|byte|double|float|long|object|octet|sequence|short|unrestricted|unsigned)$';
-my $nextType_1 = '^(::|ByteString|DOMString|USVString|Date|any|boolean|byte|double|float|long|object|octet|sequence|short|unrestricted|unsigned)$';
</del><ins>+my $nextExtendedAttributeRest3_1 = '^(\,|\])$';
+my $nextExceptionField_1 = '^(\(|ByteString|DOMString|USVString|Date|any|boolean|byte|double|float|long|object|octet|sequence|short|unrestricted|unsigned)$';
+my $nextType_1 = '^(ByteString|DOMString|USVString|Date|any|boolean|byte|double|float|long|object|octet|sequence|short|unrestricted|unsigned)$';
</ins><span class="cx"> my $nextSpecials_1 = '^(creator|deleter|getter|legacycaller|setter)$';
</span><del>-my $nextDefinitions_1 = '^(::|callback|dictionary|enum|exception|interface|partial|typedef)$';
-my $nextExceptionMembers_1 = '^(\(|::|ByteString|DOMString|USVString|Date|\[|any|boolean|byte|const|double|float|long|object|octet|optional|sequence|short|unrestricted|unsigned)$';
</del><ins>+my $nextDefinitions_1 = '^(callback|dictionary|enum|exception|interface|partial|typedef)$';
+my $nextExceptionMembers_1 = '^(\(|ByteString|DOMString|USVString|Date|\[|any|boolean|byte|const|double|float|long|object|octet|optional|sequence|short|unrestricted|unsigned)$';
</ins><span class="cx"> my $nextAttributeRest_1 = '^(attribute|readonly)$';
</span><del>-my $nextInterfaceMembers_1 = '^(\(|::|ByteString|DOMString|USVString|Date|any|attribute|boolean|byte|const|creator|deleter|double|float|getter|inherit|legacycaller|long|object|octet|readonly|sequence|serializer|setter|short|static|stringifier|unrestricted|unsigned|void)$';
-my $nextSingleType_1 = '^(::|ByteString|DOMString|USVString|Date|boolean|byte|double|float|long|object|octet|sequence|short|unrestricted|unsigned)$';
</del><ins>+my $nextInterfaceMembers_1 = '^(\(|ByteString|DOMString|USVString|Date|any|attribute|boolean|byte|const|creator|deleter|double|float|getter|inherit|legacycaller|long|object|octet|readonly|sequence|serializer|setter|short|static|stringifier|unrestricted|unsigned|void)$';
+my $nextSingleType_1 = '^(ByteString|DOMString|USVString|Date|boolean|byte|double|float|long|object|octet|sequence|short|unrestricted|unsigned)$';
</ins><span class="cx"> my $nextArgumentName_1 = '^(attribute|callback|const|creator|deleter|dictionary|enum|exception|getter|implements|inherit|interface|legacycaller|partial|serializer|setter|static|stringifier|typedef|unrestricted)$';
</span><span class="cx"> my $nextConstValue_1 = '^(false|true)$';
</span><span class="cx"> my $nextConstValue_2 = '^(-|Infinity|NaN)$';
</span><span class="cx"> my $nextDefinition_1 = '^(callback|interface)$';
</span><del>-my $nextAttributeOrOperationRest_1 = '^(\(|::|ByteString|DOMString|USVString|Date|any|boolean|byte|double|float|long|object|octet|sequence|short|unrestricted|unsigned|void)$';
</del><ins>+my $nextAttributeOrOperationRest_1 = '^(\(|ByteString|DOMString|USVString|Date|any|boolean|byte|double|float|long|object|octet|sequence|short|unrestricted|unsigned|void)$';
</ins><span class="cx"> my $nextUnsignedIntegerType_1 = '^(long|short)$';
</span><span class="cx"> my $nextDefaultValue_1 = '^(-|Infinity|NaN|false|null|true)$';
</span><span class="cx">
</span><span class="lines">@@ -480,7 +488,7 @@
</span><span class="cx"> if ($next->value() eq "typedef") {
</span><span class="cx"> return $self->parseTypedef($extendedAttributeList);
</span><span class="cx"> }
</span><del>- if ($next->type() == IdentifierToken || $next->value() eq "::") {
</del><ins>+ if ($next->type() == IdentifierToken) {
</ins><span class="cx"> return $self->parseImplementsStatement($extendedAttributeList);
</span><span class="cx"> }
</span><span class="cx"> $self->assertUnexpectedToken($next->value(), __LINE__);
</span><span class="lines">@@ -687,13 +695,10 @@
</span><span class="cx"> $member->isOptional(0);
</span><span class="cx"> }
</span><span class="cx"> $member->extendedAttributes($extendedAttributeList);
</span><ins>+
</ins><span class="cx"> my $type = $self->parseType();
</span><del>- if (typeHasNullableSuffix($type)) {
- $member->isNullable(1);
- } else {
- $member->isNullable(0);
- }
- $member->type(typeRemoveNullableSuffix($type));
</del><ins>+ $member->type($type->name);
+ $member->isNullable($type->isNullable);
</ins><span class="cx">
</span><span class="cx"> my $nameToken = $self->getToken();
</span><span class="cx"> $self->assertTokenType($nameToken, IdentifierToken);
</span><span class="lines">@@ -806,9 +811,10 @@
</span><span class="cx"> my $next = $self->nextToken();
</span><span class="cx"> if ($next->value() eq ":") {
</span><span class="cx"> $self->assertTokenValue($self->getToken(), ":", __LINE__);
</span><del>- my $scopedName = $self->parseScopedName();
- push(@parent, $scopedName);
- # Multiple inheritance (needed for ObjC bindings).
</del><ins>+ my $name = $self->parseName();
+ push(@parent, $name);
+
+ # FIXME: Remove. Was needed for needed for ObjC bindings.
</ins><span class="cx"> push(@parent, @{$self->parseIdentifiers()});
</span><span class="cx"> }
</span><span class="cx"> return \@parent;
</span><span class="lines">@@ -900,7 +906,10 @@
</span><span class="cx"> $self->assertTokenValue($self->getToken(), "typedef", __LINE__);
</span><span class="cx"> my $typedef = Typedef->new();
</span><span class="cx"> $typedef->extendedAttributes($self->parseExtendedAttributeListAllowEmpty());
</span><del>- $typedef->type($self->parseType());
</del><ins>+
+ my $type = $self->parseType();
+ $typedef->type($type->name);
+
</ins><span class="cx"> my $nameToken = $self->getToken();
</span><span class="cx"> $self->assertTokenType($nameToken, IdentifierToken);
</span><span class="cx"> $self->assertTokenValue($self->getToken(), ";", __LINE__);
</span><span class="lines">@@ -919,9 +928,9 @@
</span><span class="cx">
</span><span class="cx"> my $next = $self->nextToken();
</span><span class="cx"> if ($next->type() == IdentifierToken) {
</span><del>- $self->parseScopedName();
</del><ins>+ $self->parseName();
</ins><span class="cx"> $self->assertTokenValue($self->getToken(), "implements", __LINE__);
</span><del>- $self->parseScopedName();
</del><ins>+ $self->parseName();
</ins><span class="cx"> $self->assertTokenValue($self->getToken(), ";", __LINE__);
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="lines">@@ -937,7 +946,10 @@
</span><span class="cx"> if ($next->value() eq "const") {
</span><span class="cx"> my $newDataNode = domConstant->new();
</span><span class="cx"> $self->assertTokenValue($self->getToken(), "const", __LINE__);
</span><del>- $newDataNode->type($self->parseConstType());
</del><ins>+
+ my $type = $self->parseConstType();
+ $newDataNode->type($type->name);
+
</ins><span class="cx"> my $constNameToken = $self->getToken();
</span><span class="cx"> $self->assertTokenType($constNameToken, IdentifierToken);
</span><span class="cx"> $newDataNode->name(identifierRemoveNullablePrefix($constNameToken->value()));
</span><span class="lines">@@ -1185,12 +1197,8 @@
</span><span class="cx"> my $returnType = $self->parseReturnType();
</span><span class="cx"> my $interface = $self->parseOperationRest($extendedAttributeList);
</span><span class="cx"> if (defined ($interface)) {
</span><del>- if (typeHasNullableSuffix($returnType)) {
- $interface->signature->isNullable(1);
- } else {
- $interface->signature->isNullable(0);
- }
- $interface->signature->type(typeRemoveNullableSuffix($returnType));
</del><ins>+ $interface->signature->type($returnType->name);
+ $interface->signature->isNullable($returnType->isNullable);
</ins><span class="cx"> }
</span><span class="cx"> return $interface;
</span><span class="cx"> }
</span><span class="lines">@@ -1226,14 +1234,11 @@
</span><span class="cx"> }
</span><span class="cx"> $self->assertTokenValue($self->getToken(), "attribute", __LINE__);
</span><span class="cx"> $newDataNode->signature(domSignature->new());
</span><ins>+
</ins><span class="cx"> my $type = $self->parseType();
</span><del>- if (typeHasNullableSuffix($type)) {
- $newDataNode->signature->isNullable(1);
- } else {
- $newDataNode->signature->isNullable(0);
- }
- # Remove all "?" in the type declaration, e.g. "double?" -> "double".
- $newDataNode->signature->type(typeRemoveNullableSuffix($type));
</del><ins>+ $newDataNode->signature->type($type->name);
+ $newDataNode->signature->isNullable($type->isNullable);
+
</ins><span class="cx"> my $token = $self->getToken();
</span><span class="cx"> $self->assertTokenType($token, IdentifierToken);
</span><span class="cx"> $newDataNode->signature->name(identifierRemoveNullablePrefix($token->value()));
</span><span class="lines">@@ -1288,12 +1293,8 @@
</span><span class="cx"> my $next = $self->nextToken();
</span><span class="cx"> if ($next->type() == IdentifierToken || $next->value() eq "(") {
</span><span class="cx"> my $operation = $self->parseOperationRest($extendedAttributeList);
</span><del>- if (typeHasNullableSuffix($returnType)) {
- $operation->signature->isNullable(1);
- } else {
- $operation->signature->isNullable(0);
- }
- $operation->signature->type(typeRemoveNullableSuffix($returnType));
</del><ins>+ $operation->signature->type($returnType->name);
+ $operation->signature->isNullable($returnType->isNullable);
</ins><span class="cx">
</span><span class="cx"> return $operation;
</span><span class="cx"> }
</span><span class="lines">@@ -1313,13 +1314,8 @@
</span><span class="cx"> my $returnType = $self->parseReturnType();
</span><span class="cx"> my $interface = $self->parseOperationRest($extendedAttributeList);
</span><span class="cx"> if (defined ($interface)) {
</span><del>- if (typeHasNullableSuffix($returnType)) {
- $interface->signature->isNullable(1);
- } else {
- $interface->signature->isNullable(0);
- }
- $interface->signature->type(typeRemoveNullableSuffix($returnType));
-
</del><ins>+ $interface->signature->type($returnType->name);
+ $interface->signature->isNullable($returnType->isNullable);
</ins><span class="cx"> $interface->signature->specials(\@specials);
</span><span class="cx"> }
</span><span class="cx"> return $interface;
</span><span class="lines">@@ -1530,15 +1526,10 @@
</span><span class="cx"> my $next = $self->nextToken();
</span><span class="cx"> if ($next->value() eq "optional") {
</span><span class="cx"> $self->assertTokenValue($self->getToken(), "optional", __LINE__);
</span><ins>+
</ins><span class="cx"> my $type = $self->parseType();
</span><del>- # domDataNode can only consider last "?".
- if (typeHasNullableSuffix($type)) {
- $paramDataNode->isNullable(1);
- } else {
- $paramDataNode->isNullable(0);
- }
- # Remove "?" if exists, e.g. "object?" -> "object".
- $paramDataNode->type(identifierRemoveNullablePrefix(typeRemoveNullableSuffix($type)));
</del><ins>+ $paramDataNode->type(identifierRemoveNullablePrefix($type->name));
+ $paramDataNode->isNullable($type->isNullable);
</ins><span class="cx"> $paramDataNode->isOptional(1);
</span><span class="cx"> $paramDataNode->name($self->parseArgumentName());
</span><span class="cx"> $paramDataNode->default($self->parseDefault());
</span><span class="lines">@@ -1546,14 +1537,8 @@
</span><span class="cx"> }
</span><span class="cx"> if ($next->type() == IdentifierToken || $next->value() =~ /$nextExceptionField_1/) {
</span><span class="cx"> my $type = $self->parseType();
</span><del>- # domDataNode can only consider last "?".
- if (typeHasNullableSuffix($type)) {
- $paramDataNode->isNullable(1);
- } else {
- $paramDataNode->isNullable(0);
- }
- # Remove "?" if exists, e.g. "object?" -> "object".
- $paramDataNode->type(typeRemoveNullableSuffix($type));
</del><ins>+ $paramDataNode->type($type->name);
+ $paramDataNode->isNullable($type->isNullable);
</ins><span class="cx"> $paramDataNode->isOptional(0);
</span><span class="cx"> $paramDataNode->isVariadic($self->parseEllipsis());
</span><span class="cx"> $paramDataNode->name($self->parseArgumentName());
</span><span class="lines">@@ -1612,7 +1597,11 @@
</span><span class="cx"> $newDataNode->type("attribute");
</span><span class="cx"> $newDataNode->isReadOnly(1);
</span><span class="cx"> $newDataNode->signature(domSignature->new());
</span><del>- $newDataNode->signature->type($self->parseType());
</del><ins>+
+ my $type = $self->parseType();
+ $newDataNode->signature->type($type->name);
+ $newDataNode->signature->isNullable($type->isNullable);
+
</ins><span class="cx"> my $token = $self->getToken();
</span><span class="cx"> $self->assertTokenType($token, IdentifierToken);
</span><span class="cx"> $newDataNode->signature->name(identifierRemoveNullablePrefix($token->value()));
</span><span class="lines">@@ -1698,9 +1687,9 @@
</span><span class="cx"> {
</span><span class="cx"> my $self = shift;
</span><span class="cx"> my $next = $self->nextToken();
</span><del>- if ($next->type() == IdentifierToken || $next->value() eq "::") {
- my $scopedName = $self->parseScopedName();
- return $self->parseExtendedAttributeRest($scopedName);
</del><ins>+ if ($next->type() == IdentifierToken) {
+ my $name = $self->parseName();
+ return $self->parseExtendedAttributeRest($name);
</ins><span class="cx"> }
</span><span class="cx"> # backward compatibility. Spec doesn' allow "[]". But WebKit requires.
</span><span class="cx"> if ($next->value() eq ']') {
</span><span class="lines">@@ -1713,9 +1702,9 @@
</span><span class="cx"> {
</span><span class="cx"> my $self = shift;
</span><span class="cx"> my $next = $self->nextToken();
</span><del>- if ($next->type() == IdentifierToken || $next->value() eq "::") {
- my $scopedName = $self->parseScopedName();
- return $self->parseExtendedAttributeRest($scopedName);
</del><ins>+ if ($next->type() == IdentifierToken) {
+ my $name = $self->parseName();
+ return $self->parseExtendedAttributeRest($name);
</ins><span class="cx"> }
</span><span class="cx"> return {};
</span><span class="cx"> }
</span><span class="lines">@@ -1757,9 +1746,9 @@
</span><span class="cx"> $self->assertTokenValue($self->getToken(), ")", __LINE__);
</span><span class="cx"> return @arguments;
</span><span class="cx"> }
</span><del>- if ($next->type() == IdentifierToken || $next->value() eq "::") {
- my $scopedName = $self->parseScopedName();
- return $self->parseExtendedAttributeRest3($scopedName);
</del><ins>+ if ($next->type() == IdentifierToken) {
+ my $name = $self->parseName();
+ return $self->parseExtendedAttributeRest3($name);
</ins><span class="cx"> }
</span><span class="cx"> if ($next->type() == IntegerToken) {
</span><span class="cx"> my $token = $self->getToken();
</span><span class="lines">@@ -1776,12 +1765,12 @@
</span><span class="cx"> my $next = $self->nextToken();
</span><span class="cx"> if ($next->value() eq "&") {
</span><span class="cx"> $self->assertTokenValue($self->getToken(), "&", __LINE__);
</span><del>- my $rightValue = $self->parseScopedName();
</del><ins>+ my $rightValue = $self->parseName();
</ins><span class="cx"> return $name . "&" . $rightValue;
</span><span class="cx"> }
</span><span class="cx"> if ($next->value() eq "|") {
</span><span class="cx"> $self->assertTokenValue($self->getToken(), "|", __LINE__);
</span><del>- my $rightValue = $self->parseScopedName();
</del><ins>+ my $rightValue = $self->parseName();
</ins><span class="cx"> return $name . "|" . $rightValue;
</span><span class="cx"> }
</span><span class="cx"> if ($next->value() eq "(") {
</span><span class="lines">@@ -1792,30 +1781,12 @@
</span><span class="cx"> return $attr;
</span><span class="cx"> }
</span><span class="cx"> if ($next->type() == IdentifierToken || $next->value() =~ /$nextExtendedAttributeRest3_1/) {
</span><del>- my @names = ();
- push(@names, $name);
- push(@names, @{$self->parseScopedNameListNoComma()});
- return join(' ', @names);
</del><ins>+ $self->parseNameNoComma();
+ return $name;
</ins><span class="cx"> }
</span><span class="cx"> $self->assertUnexpectedToken($next->value());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-sub parseScopedNameListNoComma
-{
- my $self = shift;
- my @names = ();
-
- while (1) {
- my $next = $self->nextToken();
- if ($next->type() == IdentifierToken || $next->value() eq "::") {
- push(@names, $self->parseScopedName());
- } else {
- last;
- }
- }
- return \@names;
-}
-
</del><span class="cx"> sub parseArgumentNameKeyword
</span><span class="cx"> {
</span><span class="cx"> my $self = shift;
</span><span class="lines">@@ -1888,9 +1859,7 @@
</span><span class="cx"> my $self = shift;
</span><span class="cx"> my $next = $self->nextToken();
</span><span class="cx"> if ($next->value() eq "(") {
</span><del>- $self->parseUnionType();
- $self->parseTypeSuffix();
- return;
</del><ins>+ return $self->parseUnionType();
</ins><span class="cx"> }
</span><span class="cx"> if ($next->type() == IdentifierToken || $next->value() =~ /$nextType_1/) {
</span><span class="cx"> return $self->parseSingleType();
</span><span class="lines">@@ -1904,10 +1873,15 @@
</span><span class="cx"> my $next = $self->nextToken();
</span><span class="cx"> if ($next->value() eq "any") {
</span><span class="cx"> $self->assertTokenValue($self->getToken(), "any", __LINE__);
</span><del>- return "any";
</del><ins>+
+ my $anyType = domType->new();
+ $anyType->name("any");
+ return $anyType;
</ins><span class="cx"> }
</span><span class="cx"> if ($next->type() == IdentifierToken || $next->value() =~ /$nextSingleType_1/) {
</span><del>- return $self->parseNonAnyType();
</del><ins>+ my $nonAnyType = $self->parseNonAnyType();
+ $nonAnyType->isNullable($self->parseNull());
+ return $nonAnyType;
</ins><span class="cx"> }
</span><span class="cx"> $self->assertUnexpectedToken($next->value(), __LINE__);
</span><span class="cx"> }
</span><span class="lines">@@ -1916,14 +1890,24 @@
</span><span class="cx"> {
</span><span class="cx"> my $self = shift;
</span><span class="cx"> my $next = $self->nextToken();
</span><ins>+
+ my $unionType = domType->new();
+ $unionType->name("UNION");
+ $unionType->isUnion(1);
+
</ins><span class="cx"> if ($next->value() eq "(") {
</span><span class="cx"> $self->assertTokenValue($self->getToken(), "(", __LINE__);
</span><del>- $self->parseUnionMemberType();
</del><ins>+
+ push(@{$unionType->subtypes}, $self->parseUnionMemberType());
+
</ins><span class="cx"> $self->assertTokenValue($self->getToken(), "or", __LINE__);
</span><del>- $self->parseUnionMemberType();
- $self->parseUnionMemberTypes();
</del><ins>+
+ push(@{$unionType->subtypes}, $self->parseUnionMemberType());
+ push(@{$unionType->subtypes}, $self->parseUnionMemberTypes());
+
</ins><span class="cx"> $self->assertTokenValue($self->getToken(), ")", __LINE__);
</span><del>- return;
</del><ins>+
+ return $unionType;
</ins><span class="cx"> }
</span><span class="cx"> $self->assertUnexpectedToken($next->value(), __LINE__);
</span><span class="cx"> }
</span><span class="lines">@@ -1933,20 +1917,14 @@
</span><span class="cx"> my $self = shift;
</span><span class="cx"> my $next = $self->nextToken();
</span><span class="cx"> if ($next->value() eq "(") {
</span><del>- $self->parseUnionType();
- $self->parseTypeSuffix();
- return;
</del><ins>+ my $unionType = $self->parseUnionType();
+ $unionType->isNullable($self->parseNull());
+ return $unionType;
</ins><span class="cx"> }
</span><del>- if ($next->value() eq "any") {
- $self->assertTokenValue($self->getToken(), "any", __LINE__);
- $self->assertTokenValue($self->getToken(), "[", __LINE__);
- $self->assertTokenValue($self->getToken(), "]", __LINE__);
- $self->parseTypeSuffix();
- return;
- }
</del><span class="cx"> if ($next->type() == IdentifierToken || $next->value() =~ /$nextSingleType_1/) {
</span><del>- $self->parseNonAnyType();
- return;
</del><ins>+ my $nonAnyType = $self->parseNonAnyType();
+ $nonAnyType->isNullable($self->parseNull());
+ return $nonAnyType;
</ins><span class="cx"> }
</span><span class="cx"> $self->assertUnexpectedToken($next->value(), __LINE__);
</span><span class="cx"> }
</span><span class="lines">@@ -1955,11 +1933,16 @@
</span><span class="cx"> {
</span><span class="cx"> my $self = shift;
</span><span class="cx"> my $next = $self->nextToken();
</span><ins>+
+ my @subtypes = ();
+
</ins><span class="cx"> if ($next->value() eq "or") {
</span><span class="cx"> $self->assertTokenValue($self->getToken(), "or", __LINE__);
</span><del>- $self->parseUnionMemberType();
- $self->parseUnionMemberTypes();
</del><ins>+ push(@subtypes, $self->parseUnionMemberType());
+ push(@subtypes, $self->parseUnionMemberTypes());
</ins><span class="cx"> }
</span><ins>+
+ return @subtypes;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub parseNonAnyType
</span><span class="lines">@@ -1966,41 +1949,82 @@
</span><span class="cx"> {
</span><span class="cx"> my $self = shift;
</span><span class="cx"> my $next = $self->nextToken();
</span><ins>+
+ my $type = domType->new();
+
</ins><span class="cx"> if ($next->value() =~ /$nextNonAnyType_1/) {
</span><del>- return $self->parsePrimitiveType() . $self->parseTypeSuffix();
</del><ins>+ $type->name($self->parsePrimitiveType());
+ return $type;
</ins><span class="cx"> }
</span><span class="cx"> if ($next->value() eq "ByteString") {
</span><span class="cx"> $self->assertTokenValue($self->getToken(), "ByteString", __LINE__);
</span><del>- return "ByteString" . $self->parseTypeSuffix();
</del><ins>+
+ $type->name("ByteString");
+ return $type;
</ins><span class="cx"> }
</span><span class="cx"> if ($next->value() eq "DOMString") {
</span><span class="cx"> $self->assertTokenValue($self->getToken(), "DOMString", __LINE__);
</span><del>- return "DOMString" . $self->parseTypeSuffix();
</del><ins>+
+ $type->name("DOMString");
+ return $type;
</ins><span class="cx"> }
</span><span class="cx"> if ($next->value() eq "USVString") {
</span><span class="cx"> $self->assertTokenValue($self->getToken(), "USVString", __LINE__);
</span><del>- return "USVString" . $self->parseTypeSuffix();
</del><ins>+
+ $type->name("USVString");
+ return $type;
</ins><span class="cx"> }
</span><del>-
- if ($next->value() eq "sequence") {
- $self->assertTokenValue($self->getToken(), "sequence", __LINE__);
- $self->assertTokenValue($self->getToken(), "<", __LINE__);
- my $type = $self->parseType();
- $self->assertTokenValue($self->getToken(), ">", __LINE__);
- return "sequence<" . $type . ">" . $self->parseNull();
- }
</del><span class="cx"> if ($next->value() eq "object") {
</span><span class="cx"> $self->assertTokenValue($self->getToken(), "object", __LINE__);
</span><del>- return "object" . $self->parseTypeSuffix();
</del><ins>+
+ $type->name("object");
+ return $type;
</ins><span class="cx"> }
</span><ins>+ if ($next->value() eq "RegExp") {
+ $self->assertTokenValue($self->getToken(), "RegExp", __LINE__);
+
+ $type->name("RegExp");
+ return $type;
+ }
+ if ($next->value() eq "Error") {
+ $self->assertTokenValue($self->getToken(), "Error", __LINE__);
+
+ $type->name("Error");
+ return $type;
+ }
+ if ($next->value() eq "DOMException") {
+ $self->assertTokenValue($self->getToken(), "DOMException", __LINE__);
+
+ $type->name("DOMException");
+ return $type;
+ }
</ins><span class="cx"> if ($next->value() eq "Date") {
</span><span class="cx"> $self->assertTokenValue($self->getToken(), "Date", __LINE__);
</span><del>- return "Date" . $self->parseTypeSuffix();
</del><ins>+
+ $type->name("Date");
+ return $type;
</ins><span class="cx"> }
</span><del>- if ($next->type() == IdentifierToken || $next->value() eq "::") {
- my $name = identifierRemoveNullablePrefix($self->parseScopedName());
- return $name . $self->parseTypeSuffix();
</del><ins>+ if ($next->value() eq "sequence") {
+ $self->assertTokenValue($self->getToken(), "sequence", __LINE__);
+ $self->assertTokenValue($self->getToken(), "<", __LINE__);
+
+ my $subtype = $self->parseType();
+ my $subtypeName = $subtype->name;
+
+ $self->assertTokenValue($self->getToken(), ">", __LINE__);
+
+ # FIXME: This should just be "sequence" when we start using domTypes in the CodeGenerators
+ $type->name("sequence<${subtypeName}>");
+ push(@{$type->subtypes}, $subtype);
+
+ return $type;
</ins><span class="cx"> }
</span><ins>+ if ($next->type() == IdentifierToken) {
+ my $identifier = $self->getToken();
+
+ $type->name(identifierRemoveNullablePrefix($identifier->value()));
+ return $type;
+ }
</ins><span class="cx"> $self->assertUnexpectedToken($next->value(), __LINE__);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2008,12 +2032,21 @@
</span><span class="cx"> {
</span><span class="cx"> my $self = shift;
</span><span class="cx"> my $next = $self->nextToken();
</span><ins>+
+ my $type = domType->new();
+
</ins><span class="cx"> if ($next->value() =~ /$nextNonAnyType_1/) {
</span><del>- return $self->parsePrimitiveType() . $self->parseNull();
</del><ins>+ $type->name($self->parsePrimitiveType());
+ $type->isNullable($self->parseNull());
+ return $type;
</ins><span class="cx"> }
</span><span class="cx"> if ($next->type() == IdentifierToken) {
</span><del>- my $token = $self->getToken();
- return $token->value() . $self->parseNull();
</del><ins>+ my $identifier = $self->getToken();
+
+ $type->name($identifier->value());
+ $type->isNullable($self->parseNull());
+
+ return $type;
</ins><span class="cx"> }
</span><span class="cx"> $self->assertUnexpectedToken($next->value(), __LINE__);
</span><span class="cx"> }
</span><span class="lines">@@ -2119,17 +2152,6 @@
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-sub parseTypeSuffix
-{
- my $self = shift;
- my $next = $self->nextToken();
- if ($next->value() eq "?") {
- $self->assertTokenValue($self->getToken(), "?", __LINE__);
- return "?";
- }
- return "";
-}
-
</del><span class="cx"> sub parseNull
</span><span class="cx"> {
</span><span class="cx"> my $self = shift;
</span><span class="lines">@@ -2136,9 +2158,9 @@
</span><span class="cx"> my $next = $self->nextToken();
</span><span class="cx"> if ($next->value() eq "?") {
</span><span class="cx"> $self->assertTokenValue($self->getToken(), "?", __LINE__);
</span><del>- return "?";
</del><ins>+ return 1;
</ins><span class="cx"> }
</span><del>- return "";
</del><ins>+ return 0;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub parseReturnType
</span><span class="lines">@@ -2147,7 +2169,10 @@
</span><span class="cx"> my $next = $self->nextToken();
</span><span class="cx"> if ($next->value() eq "void") {
</span><span class="cx"> $self->assertTokenValue($self->getToken(), "void", __LINE__);
</span><del>- return "void";
</del><ins>+
+ my $voidType = domType->new();
+ $voidType->name("void");
+ return $voidType;
</ins><span class="cx"> }
</span><span class="cx"> if ($next->type() == IdentifierToken || $next->value() =~ /$nextExceptionField_1/) {
</span><span class="cx"> return $self->parseType();
</span><span class="lines">@@ -2175,93 +2200,30 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-sub parseScopedName
</del><ins>+sub parseNameNoComma
</ins><span class="cx"> {
</span><span class="cx"> my $self = shift;
</span><span class="cx"> my $next = $self->nextToken();
</span><del>- if ($next->value() eq "::") {
- return $self->parseAbsoluteScopedName();
- }
</del><span class="cx"> if ($next->type() == IdentifierToken) {
</span><del>- return $self->parseRelativeScopedName();
</del><ins>+ my $identifier = $self->getToken();
+ return ($identifier->value());
</ins><span class="cx"> }
</span><del>- $self->assertUnexpectedToken($next->value());
-}
</del><span class="cx">
</span><del>-sub parseAbsoluteScopedName
-{
- my $self = shift;
- my $next = $self->nextToken();
- if ($next->value() eq "::") {
- $self->assertTokenValue($self->getToken(), "::");
- my $token = $self->getToken();
- $self->assertTokenType($token, IdentifierToken);
- return "::" . $token->value() . $self->parseScopedNameParts();
- }
- $self->assertUnexpectedToken($next->value());
</del><ins>+ return ();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-sub parseRelativeScopedName
</del><ins>+sub parseName
</ins><span class="cx"> {
</span><span class="cx"> my $self = shift;
</span><span class="cx"> my $next = $self->nextToken();
</span><span class="cx"> if ($next->type() == IdentifierToken) {
</span><del>- my $token = $self->getToken();
- return $token->value() . $self->parseScopedNameParts();
</del><ins>+ my $identifier = $self->getToken();
+ return $identifier->value();
</ins><span class="cx"> }
</span><span class="cx"> $self->assertUnexpectedToken($next->value());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-sub parseScopedNameParts
-{
- my $self = shift;
- my @names = ();
</del><span class="cx">
</span><del>- while (1) {
- my $next = $self->nextToken();
- if ($next->value() eq "::") {
- $self->assertTokenValue($self->getToken(), "::");
- push(@names, "::");
- my $token = $self->getToken();
- $self->assertTokenType($token, IdentifierToken);
- push(@names, $token->value());
- } else {
- last;
- }
- }
- return join("", @names);
-}
-
-sub parseScopedNameList
-{
- my $self = shift;
- my $next = $self->nextToken();
- if ($next->type() == IdentifierToken || $next->value() eq "::") {
- my @names = ();
- push(@names, $self->parseScopedName());
- push(@names, @{$self->parseScopedNames()});
- return \@names;
- }
- $self->assertUnexpectedToken($next->value(), __LINE__);
-}
-
-sub parseScopedNames
-{
- my $self = shift;
- my @names = ();
-
- while (1) {
- my $next = $self->nextToken();
- if ($next->value() eq ",") {
- $self->assertTokenValue($self->getToken(), ",");
- push(@names, $self->parseScopedName());
- } else {
- last;
- }
- }
- return \@names;
-}
-
</del><span class="cx"> sub applyMemberList
</span><span class="cx"> {
</span><span class="cx"> my $interface = shift;
</span></span></pre>
</div>
</div>
</body>
</html>