46 " -V, -v Prints version and exits\n" |
46 " -V, -v Prints version and exits\n" |
47 "\n"); |
47 "\n"); |
48 } |
48 } |
49 |
49 |
50 /* TODO: remove this workaround after refactoring highlighter structure */ |
50 /* TODO: remove this workaround after refactoring highlighter structure */ |
51 static void plainparseline(char *src, UcxBuffer *dest, HighlighterData* hltr) { |
51 static void plainparseline(char *src, UcxBuffer *dest, int* x) { |
52 size_t dp = 0; |
52 size_t dp = 0; |
53 char *buf = dest->space + dest->pos; |
53 char *buf = dest->space + dest->pos; |
54 while (*src && *src != '\n') { |
54 while (*src && *src != '\n') { |
55 dp = writeescapedchar(buf, dp, *src); |
55 dp = writeescapedchar(buf, dp, *src); |
56 src++; |
56 src++; |
82 /* start monospace formatting */ |
82 /* start monospace formatting */ |
83 out("<pre>\n", 1, 6, stream); |
83 out("<pre>\n", 1, 6, stream); |
84 |
84 |
85 /* process lines */ |
85 /* process lines */ |
86 size_t lineno = 0; |
86 size_t lineno = 0; |
87 HighlighterData highlighter_data; |
87 int multiline_comment = 0; |
88 memset(&highlighter_data, 0, sizeof(HighlighterData)); |
|
89 |
88 |
90 UCX_FOREACH(sourceline, in) { |
89 UCX_FOREACH(sourceline, in) { |
91 /* increase line number and clean line buffer */ |
90 /* increase line number and clean line buffer */ |
92 lineno++; |
91 lineno++; |
93 ucx_buffer_clear(line); |
92 ucx_buffer_clear(line); |
98 "<a name=\"l%d\" href=\"#l%d\">%*d </a></span> ", |
97 "<a name=\"l%d\" href=\"#l%d\">%*d </a></span> ", |
99 lineno, lineno, lnw, lineno); |
98 lineno, lineno, lnw, lineno); |
100 } |
99 } |
101 |
100 |
102 /* process code line */ |
101 /* process code line */ |
103 highlighter(sourceline->data, line, &highlighter_data); |
102 highlighter(sourceline->data, line, &multiline_comment); |
104 |
103 |
105 /* write code line */ |
104 /* write code line */ |
106 out(line->space, 1, line->size, stream); |
105 out(line->space, 1, line->size, stream); |
107 } |
106 } |
108 |
107 |