static uchar In_comment;
static uchar Comment_start;
static uchar Start_html_string;
-static int Line_number;
+int Line_number;
static char *InputFile;
static gets_f Lexer_gets;
Line_number = n - 1;
}
+int aglinenumber ()
+{
+ return Line_number;
+}
+
/* (Re)set file:
*/
void agsetfile(char *f)
void agpushproto(Agraph_t *);
char *agstrdup_html(char *s);
int agtoken(char *);
+ int aglinenumber ();
void agwredge(Agraph_t *, FILE *, Agedge_t *, int);
void agwrnode(Agraph_t *, FILE *, Agnode_t *, int, int);
extern Dtdisc_t agNamedisc, agNodedisc, agOutdisc, agIndisc,
static Agraph_t *Gstack[32];
static int GSP;
+static void subgraph_warn ()
+{
+ agerr (AGWARN, "The use of \"subgraph %s\", line %d, without a body is deprecated.\n",
+ G->name, aglinenumber());
+ agerr (AGPREV, "This may cause unexpected behavior or crash the program.\n");
+ agerr (AGPREV, "Please use a single definition of the subgraph within the context of its parent graph \"%s\"\n", Gstack[GSP-2]->name);
+}
+
static void push_subg(Agraph_t *g)
{
G = Gstack[GSP++] = g;
subg_stmt : subg_hdr '{' stmt_list '}'%prec '{' {$$ = pop_gobj();}
| T_subgraph '{' { anonsubg(); } stmt_list '}' {$$ = pop_gobj();}
| '{' { anonsubg(); } stmt_list '}' {$$ = pop_gobj();}
- | subg_hdr %prec T_subgraph {$$ = pop_gobj();}
+ | subg_hdr %prec T_subgraph {subgraph_warn(); $$ = pop_gobj();}
;
subg_hdr : T_subgraph symbol