>From e1d82ff8117e2368ffe56bb8c1a5aab42750043a Mon Sep 17 00:00:00 2001 From: Jochen Keil Date: Fri, 29 Jan 2010 10:37:16 +0100 Subject: [PATCH 4/9] recognize package require|provide statements replace package require with '#include ""' --- tcl-dox.l | 15 ++++++++++++++- 1 files changed, 14 insertions(+), 1 deletions(-) diff --git a/tcl-dox.l b/tcl-dox.l index 17887c4..ee254a0 100644 --- a/tcl-dox.l +++ b/tcl-dox.l @@ -58,7 +58,7 @@ void handleArgumentComma(); %option nounput %x CBLOCK CLASS PROC PROC_OPEN PROC_ARGS OPTIONAL_ARG -%x VAR CLASS_INH INH NAMESPACE UNSUPPORTED_CMD EXEC +%x VAR CLASS_INH INH NAMESPACE UNSUPPORTED_CMD PACKAGE EXEC ID [[:alpha:]_]+[[:alnum:]_]* WS [ \t] @@ -135,6 +135,10 @@ WS [ \t] BEGIN(VAR); } + "package"[ \t]+ { + BEGIN(PACKAGE); + } + \} { @@ -170,6 +174,15 @@ WS [ \t] } +{ + "require"[ \t]+.* { + fprintf(yyout, "%s \"%s\"\n", "#include", yytext + strlen("require") + 1); + BEGIN(INITIAL); + } + .* { + BEGIN(INITIAL); + } +} { ^{WS}*#.*$ { -- 1.6.6.1