From 9ace2b1f113399d0b520fca84718ec7862abc61f Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Sun, 23 Nov 2008 23:35:25 +0000 Subject: Added initial support for callable/parsable. --- html4_strict.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 48 insertions(+), 5 deletions(-) diff --git a/html4_strict.c b/html4_strict.c index 16a66da6..d170855b 100644 --- a/html4_strict.c +++ b/html4_strict.c @@ -1,4 +1,4 @@ -/* $Id: html4_strict.c,v 1.4 2008/11/23 23:12:47 kristaps Exp $ */ +/* $Id: html4_strict.c,v 1.5 2008/11/23 23:35:25 kristaps Exp $ */ /* * Copyright (c) 2008 Kristaps Dzonsons * @@ -472,6 +472,8 @@ static int roff_Dd(ROFFCALL_ARGS) { + dbg_enter(arg, ROFF_Dd); + assert(ROFF_PRELUDE & tree->state); if (ROFF_PRELUDE_Dt & tree->state || ROFF_PRELUDE_Dd & tree->state) { @@ -483,7 +485,8 @@ roff_Dd(ROFFCALL_ARGS) assert(NULL == tree->last); tree->state |= ROFF_PRELUDE_Dd; - dbg_enter(arg, ROFF_Dd); + dbg_leave(arg, ROFF_Dd); + return(1); } @@ -492,6 +495,8 @@ static int roff_Dt(ROFFCALL_ARGS) { + dbg_enter(arg, ROFF_Dt); + assert(ROFF_PRELUDE & tree->state); if ( ! (ROFF_PRELUDE_Dd & tree->state) || (ROFF_PRELUDE_Dt & tree->state)) { @@ -503,7 +508,8 @@ roff_Dt(ROFFCALL_ARGS) assert(NULL == tree->last); tree->state |= ROFF_PRELUDE_Dt; - dbg_enter(arg, ROFF_Dt); + dbg_leave(arg, ROFF_Dt); + return(1); } @@ -518,6 +524,8 @@ roff_Os(ROFFCALL_ARGS) return(1); } + dbg_enter(arg, ROFF_Os); + assert(ROFF_PRELUDE & tree->state); if ( ! (ROFF_PRELUDE_Dt & tree->state) || ! (ROFF_PRELUDE_Dd & tree->state)) { @@ -534,7 +542,6 @@ roff_Os(ROFFCALL_ARGS) tree->state &= ~ROFF_PRELUDE; tree->state |= ROFF_BODY; - dbg_enter(arg, ROFF_Os); return(1); } @@ -549,10 +556,13 @@ roff_Sh(ROFFCALL_ARGS) return(1); } + dbg_enter(arg, ROFF_Sh); + if (NULL == roffnode_new(ROFF_Sh, in->line, tree)) return(0); - dbg_enter(arg, ROFF_Sh); + dbg_leave(arg, ROFF_Li); + return(1); } @@ -561,13 +571,46 @@ static int roff_Li(ROFFCALL_ARGS) { + dbg_enter(arg, ROFF_Li); + dbg_leave(arg, ROFF_Li); + return(1); } +#if 0 +static int +parse_args(void) +{ + skip_whitespace(); + + while (pos < sz) { + + if (is_arg) { + } else if (parsable) { + if (is_callable_token()) { + } + } + + skip_whitespace(); + } +} +#endif + + static int roff_An(ROFFCALL_ARGS) { + dbg_enter(arg, ROFF_An); + + /* Do our ML stuff. */ + + /*parse_args();*/ + + /* Do our trailing whitespace stuff. */ + + dbg_leave(arg, ROFF_An); + return(1); } -- cgit v1.2.3-56-ge451