...
 
Commits (2)
......@@ -92,6 +92,9 @@ class NonblockingStream
{
inherit Stream;
//! @decl @Pike.Implements(Stream)
@__builtin.Implements(Stream);
//!
NonblockingStream set_read_callback( function f, mixed ... rest );
NonblockingStream set_write_callback( function f, mixed ... rest );
......@@ -130,6 +133,9 @@ class BlockFile
{
inherit Stream;
//! @decl @Pike.Implements(Stream)
@__builtin.Implements(Stream);
//!
int seek(int to, string|void how);
......@@ -183,6 +189,12 @@ class File
{
optional inherit Fd;
//! @decl @Pike.Implements(NonblockingStream)
@__builtin.Implements(NonblockingStream);
//! @decl @Pike.Implements(BlockFile)
@__builtin.Implements(BlockFile);
// This is needed in case we get overloaded by strange code
// (socktest.pike).
protected Fd fd_factory()
......
......@@ -246,8 +246,7 @@ private class Extractor {
object(PikeObject)|array(PikeObject)|Annotation p = parser->parseDecl();
if (objectp(p) && p->is_annotation) {
c->annotations += ({ p });
continue;
return ({ ({ p }), 0 });
}
multiset(string) allowSqueeze = (<
......@@ -372,7 +371,7 @@ private class Extractor {
}
}
foreach (decls, PikeObject obj)
foreach (decls, object(PikeObject)|Annotation obj)
if (obj->squeezedInDoc) {
if (sizeof(decls) > 1)
extractorError(
......@@ -382,10 +381,10 @@ private class Extractor {
extractorError("duplicate documentation");
doc = obj->squeezedInDoc;
}
array(PikeObject) docDecls = ({ });
array(PikeObject|Annotation) docDecls = ({ });
if (!doc) {
foreach (decls, PikeObject obj)
foreach (decls, object(PikeObject)|Annotation obj)
if ((< "class", "enum" >)[obj->objtype] && obj->containsDoc()) {
extractorWarning("undocumented %s %O contains doc comments",
obj->objtype, obj->name);
......@@ -471,12 +470,12 @@ private class Extractor {
if (sizeof(decls)) {
if (sizeof(decls) != 1)
extractorError("only one pike declaration can be combined with @decl %O", decls->position);
foreach(docDecls, PikeObject d)
foreach(docDecls, object(PikeObject)|Annotation d)
if (decls[0]->objtype != d->objtype)
extractorError("@decl of %s mismatches %s in pike code",
d->objtype, decls[0]->objtype);
foreach(docDecls, PikeObject d)
if (decls[0]->name != d->name)
foreach(docDecls, object(PikeObject)|Annotation d)
if ((d->objtype != "annotation") && (decls[0]->name != d->name))
extractorError("@decl'd %s %s mismatches %s %s in pike code",
d->objtype, d->name, d->objtype, decls[0]->name);
}
......@@ -518,8 +517,12 @@ private class Extractor {
mapping(string:int) contexts = ([]);
foreach(decls, PikeObject obj)
foreach(decls, object(PikeObject)|Annotation obj) {
if (obj->objtype == "annotation") {
c->annotations += ({ obj });
}
contexts[obj->objtype] = 1;
}
if (doc) {
if (wasNonGroupable) {
......
......@@ -576,12 +576,14 @@ class DocGroup {
// REPRESENTATION OF PIKES LEXICAL OBJECTS (class, function, variable ...)
//========================================================================
class Annotation(array(string) tokens)
class Annotation
{
constant is_annotation = 1;
constant objtype = "annotation";
array(string) tokens;
string xml(.Flags|void flags)
{
return xmltag("annotation", tokens * "");
......@@ -591,6 +593,11 @@ class Annotation(array(string) tokens)
{
return tokens * "";
}
protected void create(array(string) tokens)
{
this::tokens = filter(tokens, `!=, "\n");
}
}
//! Base class for representing a documentable Pike lexical entity.
......