source: tol/tolbase/lib/markupparser/markupparser.bench

devel
Last change on this file was a680983, checked in by Jorge Pérez <josp.jorge@…>, 15 years ago

refs #1347, hipertext widget extracted from Notebook App

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@3878 be4846ae-f051-483a-831f-b64e7d08527f

  • Property mode set to 100644
File size: 16.9 KB
Line 
1source markupparser.tcl
2
3set text {
4    This is a one line paragraph.
5
6This is a <b>two</b> line [paragraph with] a link
7and a [%Button|magic%].
8
9:: This is a two line indented paragraph that's supposed to wrap to
10the next line because it's so long and to be indented properly when it
11gets there.
12
13** This is a two line bulleted paragraph that's supposed to wrap to
14the next line because it's so long and to be indented properly when it
15gets there.
16
17 This is a two line
18Preformatted paragraph.
19* <i>Three</i>
20** Bulleted
21*** Paragraphs
22#---
23And here's a <m>paragraph</m> with [%One|button%]
24and [%Another|Button [with brackets]%].
25
26[@Bogus Macro@]
27#hash check
28: And one <h>indented</h> one.
29
30And the rest is preformatted,
31* No matter what it is.
32
33This is a one line paragraph.
34
35This is a <b>two</b> line [paragraph with] a link
36and a [%Button|magic%].
37
38:: This is a two line indented paragraph that's supposed to wrap to
39the next line because it's so long and to be indented properly when it
40gets there.
41
42** This is a two line bulleted paragraph that's supposed to wrap to
43the next line because it's so long and to be indented properly when it
44gets there.
45
46 This is a two line
47Preformatted paragraph.
48* <i>Three</i>
49** Bulleted
50*** Paragraphs
51#---
52And here's a <m>paragraph</m> with [%One|button%]
53and [%Another|Button [with brackets]%].
54
55[@Bogus Macro@]
56#hash check
57: And one <h>indented</h> one.
58
59And the rest is preformatted,
60* No matter what it is.
61
62This is a one line paragraph.
63
64This is a <b>two</b> line [paragraph with] a link
65and a [%Button|magic%].
66
67:: This is a two line indented paragraph that's supposed to wrap to
68the next line because it's so long and to be indented properly when it
69gets there.
70
71** This is a two line bulleted paragraph that's supposed to wrap to
72the next line because it's so long and to be indented properly when it
73gets there.
74
75 This is a two line
76Preformatted paragraph.
77* <i>Three</i>
78** Bulleted
79*** Paragraphs
80#---
81And here's a <m>paragraph</m> with [%One|button%]
82and [%Another|Button [with brackets]%].
83
84[@Bogus Macro@]
85#hash check
86: And one <h>indented</h> one.
87
88And the rest is preformatted,
89* No matter what it is.
90
91This is a one line paragraph.
92
93This is a <b>two</b> line [paragraph with] a link
94and a [%Button|magic%].
95
96:: This is a two line indented paragraph that's supposed to wrap to
97the next line because it's so long and to be indented properly when it
98gets there.
99
100** This is a two line bulleted paragraph that's supposed to wrap to
101the next line because it's so long and to be indented properly when it
102gets there.
103
104 This is a two line
105Preformatted paragraph.
106* <i>Three</i>
107** Bulleted
108*** Paragraphs
109#---
110And here's a <m>paragraph</m> with [%One|button%]
111and [%Another|Button [with brackets]%].
112
113[@Bogus Macro@]
114#hash check
115: And one <h>indented</h> one.
116
117And the rest is preformatted,
118* No matter what it is.
119
120This is a one line paragraph.
121
122This is a <b>two</b> line [paragraph with] a link
123and a [%Button|magic%].
124
125:: This is a two line indented paragraph that's supposed to wrap to
126the next line because it's so long and to be indented properly when it
127gets there.
128
129** This is a two line bulleted paragraph that's supposed to wrap to
130the next line because it's so long and to be indented properly when it
131gets there.
132
133 This is a two line
134Preformatted paragraph.
135* <i>Three</i>
136** Bulleted
137*** Paragraphs
138#---
139And here's a <m>paragraph</m> with [%One|button%]
140and [%Another|Button [with brackets]%].
141
142[@Bogus Macro@]
143#hash check
144: And one <h>indented</h> one.
145
146And the rest is preformatted,
147* No matter what it is.
148
149This is a one line paragraph.
150
151This is a <b>two</b> line [paragraph with] a link
152and a [%Button|magic%].
153
154:: This is a two line indented paragraph that's supposed to wrap to
155the next line because it's so long and to be indented properly when it
156gets there.
157
158** This is a two line bulleted paragraph that's supposed to wrap to
159the next line because it's so long and to be indented properly when it
160gets there.
161
162 This is a two line
163Preformatted paragraph.
164* <i>Three</i>
165** Bulleted
166*** Paragraphs
167#---
168And here's a <m>paragraph</m> with [%One|button%]
169and [%Another|Button [with brackets]%].
170
171[@Bogus Macro@]
172#hash check
173: And one <h>indented</h> one.
174
175And the rest is preformatted,
176* No matter what it is.
177
178This is a one line paragraph.
179
180This is a <b>two</b> line [paragraph with] a link
181and a [%Button|magic%].
182
183:: This is a two line indented paragraph that's supposed to wrap to
184the next line because it's so long and to be indented properly when it
185gets there.
186
187** This is a two line bulleted paragraph that's supposed to wrap to
188the next line because it's so long and to be indented properly when it
189gets there.
190
191 This is a two line
192Preformatted paragraph.
193* <i>Three</i>
194** Bulleted
195*** Paragraphs
196#---
197And here's a <m>paragraph</m> with [%One|button%]
198and [%Another|Button [with brackets]%].
199
200[@Bogus Macro@]
201#hash check
202: And one <h>indented</h> one.
203
204And the rest is preformatted,
205* No matter what it is.
206
207This is a one line paragraph.
208
209This is a <b>two</b> line [paragraph with] a link
210and a [%Button|magic%].
211
212:: This is a two line indented paragraph that's supposed to wrap to
213the next line because it's so long and to be indented properly when it
214gets there.
215
216** This is a two line bulleted paragraph that's supposed to wrap to
217the next line because it's so long and to be indented properly when it
218gets there.
219
220 This is a two line
221Preformatted paragraph.
222* <i>Three</i>
223** Bulleted
224*** Paragraphs
225#---
226And here's a <m>paragraph</m> with [%One|button%]
227and [%Another|Button [with brackets]%].
228
229[@Bogus Macro@]
230#hash check
231: And one <h>indented</h> one.
232
233And the rest is preformatted,
234* No matter what it is.
235
236This is a one line paragraph.
237
238This is a <b>two</b> line [paragraph with] a link
239and a [%Button|magic%].
240
241:: This is a two line indented paragraph that's supposed to wrap to
242the next line because it's so long and to be indented properly when it
243gets there.
244
245** This is a two line bulleted paragraph that's supposed to wrap to
246the next line because it's so long and to be indented properly when it
247gets there.
248
249 This is a two line
250Preformatted paragraph.
251* <i>Three</i>
252** Bulleted
253*** Paragraphs
254#---
255And here's a <m>paragraph</m> with [%One|button%]
256and [%Another|Button [with brackets]%].
257
258[@Bogus Macro@]
259#hash check
260: And one <h>indented</h> one.
261
262And the rest is preformatted,
263* No matter what it is.
264
265This is a one line paragraph.
266
267This is a <b>two</b> line [paragraph with] a link
268and a [%Button|magic%].
269
270:: This is a two line indented paragraph that's supposed to wrap to
271the next line because it's so long and to be indented properly when it
272gets there.
273
274** This is a two line bulleted paragraph that's supposed to wrap to
275the next line because it's so long and to be indented properly when it
276gets there.
277
278 This is a two line
279Preformatted paragraph.
280* <i>Three</i>
281** Bulleted
282*** Paragraphs
283#---
284And here's a <m>paragraph</m> with [%One|button%]
285and [%Another|Button [with brackets]%].
286
287[@Bogus Macro@]
288#hash check
289: And one <h>indented</h> one.
290
291And the rest is preformatted,
292* No matter what it is.
293
294This is a one line paragraph.
295
296This is a <b>two</b> line [paragraph with] a link
297and a [%Button|magic%].
298
299:: This is a two line indented paragraph that's supposed to wrap to
300the next line because it's so long and to be indented properly when it
301gets there.
302
303** This is a two line bulleted paragraph that's supposed to wrap to
304the next line because it's so long and to be indented properly when it
305gets there.
306
307 This is a two line
308Preformatted paragraph.
309* <i>Three</i>
310** Bulleted
311*** Paragraphs
312#---
313And here's a <m>paragraph</m> with [%One|button%]
314and [%Another|Button [with brackets]%].
315
316[@Bogus Macro@]
317#hash check
318: And one <h>indented</h> one.
319
320And the rest is preformatted,
321* No matter what it is.
322
323This is a one line paragraph.
324
325This is a <b>two</b> line [paragraph with] a link
326and a [%Button|magic%].
327
328:: This is a two line indented paragraph that's supposed to wrap to
329the next line because it's so long and to be indented properly when it
330gets there.
331
332** This is a two line bulleted paragraph that's supposed to wrap to
333the next line because it's so long and to be indented properly when it
334gets there.
335
336 This is a two line
337Preformatted paragraph.
338* <i>Three</i>
339** Bulleted
340*** Paragraphs
341#---
342And here's a <m>paragraph</m> with [%One|button%]
343and [%Another|Button [with brackets]%].
344
345[@Bogus Macro@]
346#hash check
347: And one <h>indented</h> one.
348
349And the rest is preformatted,
350* No matter what it is.
351
352This is a one line paragraph.
353
354This is a <b>two</b> line [paragraph with] a link
355and a [%Button|magic%].
356
357:: This is a two line indented paragraph that's supposed to wrap to
358the next line because it's so long and to be indented properly when it
359gets there.
360
361** This is a two line bulleted paragraph that's supposed to wrap to
362the next line because it's so long and to be indented properly when it
363gets there.
364
365 This is a two line
366Preformatted paragraph.
367* <i>Three</i>
368** Bulleted
369*** Paragraphs
370#---
371And here's a <m>paragraph</m> with [%One|button%]
372and [%Another|Button [with brackets]%].
373
374[@Bogus Macro@]
375#hash check
376: And one <h>indented</h> one.
377
378And the rest is preformatted,
379* No matter what it is.
380
381This is a one line paragraph.
382
383This is a <b>two</b> line [paragraph with] a link
384and a [%Button|magic%].
385
386:: This is a two line indented paragraph that's supposed to wrap to
387the next line because it's so long and to be indented properly when it
388gets there.
389
390** This is a two line bulleted paragraph that's supposed to wrap to
391the next line because it's so long and to be indented properly when it
392gets there.
393
394 This is a two line
395Preformatted paragraph.
396* <i>Three</i>
397** Bulleted
398*** Paragraphs
399#---
400And here's a <m>paragraph</m> with [%One|button%]
401and [%Another|Button [with brackets]%].
402
403[@Bogus Macro@]
404#hash check
405: And one <h>indented</h> one.
406
407And the rest is preformatted,
408* No matter what it is.
409
410This is a one line paragraph.
411
412This is a <b>two</b> line [paragraph with] a link
413and a [%Button|magic%].
414
415:: This is a two line indented paragraph that's supposed to wrap to
416the next line because it's so long and to be indented properly when it
417gets there.
418
419** This is a two line bulleted paragraph that's supposed to wrap to
420the next line because it's so long and to be indented properly when it
421gets there.
422
423 This is a two line
424Preformatted paragraph.
425* <i>Three</i>
426** Bulleted
427*** Paragraphs
428#---
429And here's a <m>paragraph</m> with [%One|button%]
430and [%Another|Button [with brackets]%].
431
432[@Bogus Macro@]
433#hash check
434: And one <h>indented</h> one.
435
436And the rest is preformatted,
437* No matter what it is.
438
439This is a one line paragraph.
440
441This is a <b>two</b> line [paragraph with] a link
442and a [%Button|magic%].
443
444:: This is a two line indented paragraph that's supposed to wrap to
445the next line because it's so long and to be indented properly when it
446gets there.
447
448** This is a two line bulleted paragraph that's supposed to wrap to
449the next line because it's so long and to be indented properly when it
450gets there.
451
452 This is a two line
453Preformatted paragraph.
454* <i>Three</i>
455** Bulleted
456*** Paragraphs
457#---
458And here's a <m>paragraph</m> with [%One|button%]
459and [%Another|Button [with brackets]%].
460
461[@Bogus Macro@]
462#hash check
463: And one <h>indented</h> one.
464
465And the rest is preformatted,
466* No matter what it is.
467
468This is a one line paragraph.
469
470This is a <b>two</b> line [paragraph with] a link
471and a [%Button|magic%].
472
473:: This is a two line indented paragraph that's supposed to wrap to
474the next line because it's so long and to be indented properly when it
475gets there.
476
477** This is a two line bulleted paragraph that's supposed to wrap to
478the next line because it's so long and to be indented properly when it
479gets there.
480
481 This is a two line
482Preformatted paragraph.
483* <i>Three</i>
484** Bulleted
485*** Paragraphs
486#---
487And here's a <m>paragraph</m> with [%One|button%]
488and [%Another|Button [with brackets]%].
489
490[@Bogus Macro@]
491#hash check
492: And one <h>indented</h> one.
493
494And the rest is preformatted,
495* No matter what it is.
496
497This is a one line paragraph.
498
499This is a <b>two</b> line [paragraph with] a link
500and a [%Button|magic%].
501
502:: This is a two line indented paragraph that's supposed to wrap to
503the next line because it's so long and to be indented properly when it
504gets there.
505
506** This is a two line bulleted paragraph that's supposed to wrap to
507the next line because it's so long and to be indented properly when it
508gets there.
509
510 This is a two line
511Preformatted paragraph.
512* <i>Three</i>
513** Bulleted
514*** Paragraphs
515#---
516And here's a <m>paragraph</m> with [%One|button%]
517and [%Another|Button [with brackets]%].
518
519[@Bogus Macro@]
520#hash check
521: And one <h>indented</h> one.
522
523And the rest is preformatted,
524* No matter what it is.
525
526This is a one line paragraph.
527
528This is a <b>two</b> line [paragraph with] a link
529and a [%Button|magic%].
530
531:: This is a two line indented paragraph that's supposed to wrap to
532the next line because it's so long and to be indented properly when it
533gets there.
534
535** This is a two line bulleted paragraph that's supposed to wrap to
536the next line because it's so long and to be indented properly when it
537gets there.
538
539 This is a two line
540Preformatted paragraph.
541* <i>Three</i>
542** Bulleted
543*** Paragraphs
544#---
545And here's a <m>paragraph</m> with [%One|button%]
546and [%Another|Button [with brackets]%].
547
548[@Bogus Macro@]
549#hash check
550: And one <h>indented</h> one.
551
552And the rest is preformatted,
553* No matter what it is.
554
555This is a one line paragraph.
556
557This is a <b>two</b> line [paragraph with] a link
558and a [%Button|magic%].
559
560:: This is a two line indented paragraph that's supposed to wrap to
561the next line because it's so long and to be indented properly when it
562gets there.
563
564** This is a two line bulleted paragraph that's supposed to wrap to
565the next line because it's so long and to be indented properly when it
566gets there.
567
568 This is a two line
569Preformatted paragraph.
570* <i>Three</i>
571** Bulleted
572*** Paragraphs
573#---
574And here's a <m>paragraph</m> with [%One|button%]
575and [%Another|Button [with brackets]%].
576
577[@Bogus Macro@]
578#hash check
579: And one <h>indented</h> one.
580
581And the rest is preformatted,
582* No matter what it is.
583
584This is a one line paragraph.
585
586This is a <b>two</b> line [paragraph with] a link
587and a [%Button|magic%].
588
589:: This is a two line indented paragraph that's supposed to wrap to
590the next line because it's so long and to be indented properly when it
591gets there.
592
593** This is a two line bulleted paragraph that's supposed to wrap to
594the next line because it's so long and to be indented properly when it
595gets there.
596
597 This is a two line
598Preformatted paragraph.
599* <i>Three</i>
600** Bulleted
601*** Paragraphs
602#---
603And here's a <m>paragraph</m> with [%One|button%]
604and [%Another|Button [with brackets]%].
605
606[@Bogus Macro@]
607#hash check
608: And one <h>indented</h> one.
609
610And the rest is preformatted,
611* No matter what it is.
612
613This is a one line paragraph.
614
615This is a <b>two</b> line [paragraph with] a link
616and a [%Button|magic%].
617
618:: This is a two line indented paragraph that's supposed to wrap to
619the next line because it's so long and to be indented properly when it
620gets there.
621
622** This is a two line bulleted paragraph that's supposed to wrap to
623the next line because it's so long and to be indented properly when it
624gets there.
625
626 This is a two line
627Preformatted paragraph.
628* <i>Three</i>
629** Bulleted
630*** Paragraphs
631#---
632And here's a <m>paragraph</m> with [%One|button%]
633and [%Another|Button [with brackets]%].
634
635[@Bogus Macro@]
636#hash check
637: And one <h>indented</h> one.
638
639And the rest is preformatted,
640* No matter what it is.
641
642This is a one line paragraph.
643
644This is a <b>two</b> line [paragraph with] a link
645and a [%Button|magic%].
646
647:: This is a two line indented paragraph that's supposed to wrap to
648the next line because it's so long and to be indented properly when it
649gets there.
650
651** This is a two line bulleted paragraph that's supposed to wrap to
652the next line because it's so long and to be indented properly when it
653gets there.
654
655 This is a two line
656Preformatted paragraph.
657* <i>Three</i>
658** Bulleted
659*** Paragraphs
660#---
661And here's a <m>paragraph</m> with [%One|button%]
662and [%Another|Button [with brackets]%].
663
664[@Bogus Macro@]
665#hash check
666: And one <h>indented</h> one.
667
668And the rest is preformatted,
669* No matter what it is.
670
671This is a one line paragraph.
672
673This is a <b>two</b> line [paragraph with] a link
674and a [%Button|magic%].
675
676:: This is a two line indented paragraph that's supposed to wrap to
677the next line because it's so long and to be indented properly when it
678gets there.
679
680** This is a two line bulleted paragraph that's supposed to wrap to
681the next line because it's so long and to be indented properly when it
682gets there.
683
684 This is a two line
685Preformatted paragraph.
686* <i>Three</i>
687** Bulleted
688*** Paragraphs
689#---
690And here's a <m>paragraph</m> with [%One|button%]
691and [%Another|Button [with brackets]%].
692
693[@Bogus Macro@]
694#hash check
695: And one <h>indented</h> one.
696
697And the rest is preformatted,
698* No matter what it is.
699}
700
701proc test1 {text} {
702    set result [markupparser::parse $text]
703}
704
705proc test2 {text} {
706    set result {}
707    foreach {key val} [markupparser::parseExperimental $text] {
708        lappend result $key $val
709    }
710
711}
712
713puts [time {test1 $text}]
714puts [time {test2 $text}]
Note: See TracBrowser for help on using the repository browser.