>From d089856a5b473fd3806ec226f707bb1985bb22aa Mon Sep 17 00:00:00 2001
From: Jochen Keil <jochen.keil@emlix.com>
Date: Fri, 29 Jan 2010 13:46:53 +0100
Subject: [PATCH 5/9] consume whole content of a proc declaration
this is done by counting '{' and '}'. we start with an open bracket and
increase the counter for every subsequent open bracket whereas for every
close bracket we'll decrease the count by one.
when the counter is one again we have reached the closing bracket of the
proc and we can start from initial again.
this ensures that anything inside of a proc won't confuse the rest of
tcl-dox.l | 36 ++++++++++++++++++++++++++++++++----
1 files changed, 32 insertions(+), 4 deletions(-)
diff --git a/tcl-dox.l b/tcl-dox.l
index ee254a0..21afca5 100644
@@ -28,6 +28,11 @@ int g_firstArg;
+ * count brackets inside of proc statements so the function body can be
+ * ignored and won't confuse the lexer with keywords */
* Keeps track of the current class name. This is needed for correct
* output of constructors and destructors using C++ syntax.
@@ -57,7 +62,7 @@ void handleArgumentComma();
-%x CBLOCK CLASS PROC PROC_OPEN PROC_ARGS OPTIONAL_ARG
+%x CBLOCK CLASS PROC PROC_OPEN PROC_ARGS PROC_EAT OPTIONAL_ARG
%x VAR CLASS_INH INH NAMESPACE UNSUPPORTED_CMD PACKAGE EXEC
ID [[:alpha:]_]+[[:alnum:]_]*
@@ -290,8 +295,8 @@ WS [ \t]
- fprintf(yyout, "%s", ")");
+ fprintf(yyout, "%s\n%s", ")", "{");
@@ -307,7 +312,30 @@ WS [ \t]