gv-RedCloth 4.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gemtest +0 -0
- data/.rspec +1 -0
- data/CHANGELOG +261 -0
- data/COPYING +18 -0
- data/Gemfile +7 -0
- data/README.rdoc +198 -0
- data/Rakefile +18 -0
- data/bin/redcloth +28 -0
- data/doc/textile_reference.html +631 -0
- data/ext/redcloth_scan/extconf.rb +6 -0
- data/ext/redcloth_scan/redcloth.h +220 -0
- data/ext/redcloth_scan/redcloth_attributes.c +650 -0
- data/ext/redcloth_scan/redcloth_inline.c +7952 -0
- data/ext/redcloth_scan/redcloth_scan.c +24407 -0
- data/lib/case_sensitive_require/RedCloth.rb +6 -0
- data/lib/redcloth.rb +45 -0
- data/lib/redcloth/erb_extension.rb +27 -0
- data/lib/redcloth/formatters/base.rb +63 -0
- data/lib/redcloth/formatters/html.rb +345 -0
- data/lib/redcloth/formatters/latex.rb +322 -0
- data/lib/redcloth/formatters/latex_entities.yml +2414 -0
- data/lib/redcloth/textile_doc.rb +103 -0
- data/lib/redcloth/version.rb +34 -0
- data/lib/tasks/pureruby.rake +17 -0
- data/redcloth.gemspec +52 -0
- data/spec/benchmark_spec.rb +15 -0
- data/spec/custom_tags_spec.rb +50 -0
- data/spec/erb_spec.rb +10 -0
- data/spec/extension_spec.rb +26 -0
- data/spec/fixtures/basic.yml +1028 -0
- data/spec/fixtures/code.yml +257 -0
- data/spec/fixtures/definitions.yml +82 -0
- data/spec/fixtures/extra_whitespace.yml +64 -0
- data/spec/fixtures/filter_html.yml +177 -0
- data/spec/fixtures/filter_pba.yml +20 -0
- data/spec/fixtures/html.yml +348 -0
- data/spec/fixtures/images.yml +279 -0
- data/spec/fixtures/instiki.yml +38 -0
- data/spec/fixtures/links.yml +291 -0
- data/spec/fixtures/lists.yml +462 -0
- data/spec/fixtures/poignant.yml +89 -0
- data/spec/fixtures/sanitize_html.yml +42 -0
- data/spec/fixtures/table.yml +434 -0
- data/spec/fixtures/textism.yml +509 -0
- data/spec/fixtures/threshold.yml +762 -0
- data/spec/formatters/class_filtered_html_spec.rb +7 -0
- data/spec/formatters/filtered_html_spec.rb +7 -0
- data/spec/formatters/html_no_breaks_spec.rb +9 -0
- data/spec/formatters/html_spec.rb +13 -0
- data/spec/formatters/id_filtered_html_spec.rb +7 -0
- data/spec/formatters/latex_spec.rb +13 -0
- data/spec/formatters/lite_mode_html_spec.rb +7 -0
- data/spec/formatters/no_span_caps_html_spec.rb +7 -0
- data/spec/formatters/sanitized_html_spec.rb +7 -0
- data/spec/formatters/style_filtered_html_spec.rb +7 -0
- data/spec/parser_spec.rb +102 -0
- data/spec/spec_helper.rb +36 -0
- data/tasks/compile.rake +47 -0
- data/tasks/gems.rake +37 -0
- data/tasks/ragel_extension_task.rb +127 -0
- data/tasks/release.rake +15 -0
- data/tasks/rspec.rake +13 -0
- data/tasks/rvm.rake +79 -0
- metadata +227 -0
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
#ifndef redcloth_h
|
|
2
|
+
#define redcloth_h
|
|
3
|
+
|
|
4
|
+
#ifndef RARRAY_LEN
|
|
5
|
+
#define RARRAY_LEN(arr) RARRAY(arr)->len
|
|
6
|
+
#define RSTRING_LEN(str) RSTRING(str)->len
|
|
7
|
+
#define RSTRING_PTR(str) RSTRING(str)->ptr
|
|
8
|
+
#endif
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
// Different string conversions for ruby 1.8 and ruby 1.9. For 1.9,
|
|
12
|
+
// we need to set the encoding of the string.
|
|
13
|
+
|
|
14
|
+
// For Ruby 1.9
|
|
15
|
+
#ifdef HAVE_RUBY_ENCODING_H
|
|
16
|
+
#include "ruby/encoding.h"
|
|
17
|
+
#define STR_NEW(p,n) rb_enc_str_new((p),(n),rb_enc_from_index(ENCODING_GET(self)))
|
|
18
|
+
#define STR_NEW2(p) rb_enc_str_new((p),strlen(p),rb_enc_from_index(ENCODING_GET(self)))
|
|
19
|
+
|
|
20
|
+
// For Ruby 1.8
|
|
21
|
+
#else
|
|
22
|
+
#define STR_NEW(p,n) rb_str_new((p),(n))
|
|
23
|
+
#define STR_NEW2(p) rb_str_new2((p))
|
|
24
|
+
|
|
25
|
+
#endif
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
/* variable defs */
|
|
29
|
+
#ifndef redcloth_scan_c
|
|
30
|
+
extern VALUE super_ParseError, mRedCloth, super_RedCloth;
|
|
31
|
+
extern int SYM_escape_preformatted;
|
|
32
|
+
#endif
|
|
33
|
+
|
|
34
|
+
/* function defs */
|
|
35
|
+
void rb_str_cat_escaped(VALUE self, VALUE str, char *ts, char *te);
|
|
36
|
+
void rb_str_cat_escaped_for_preformatted(VALUE self, VALUE str, char *ts, char *te);
|
|
37
|
+
VALUE redcloth_inline(VALUE, char *, char *, VALUE);
|
|
38
|
+
VALUE redcloth_inline2(VALUE, VALUE, VALUE);
|
|
39
|
+
VALUE redcloth_attribute_parser(int, VALUE, char *, char *);
|
|
40
|
+
VALUE redcloth_attributes(VALUE, VALUE);
|
|
41
|
+
VALUE redcloth_link_attributes(VALUE, VALUE);
|
|
42
|
+
VALUE red_parse_title(VALUE, VALUE, VALUE);
|
|
43
|
+
VALUE redcloth_transform(VALUE, char *, char *, VALUE);
|
|
44
|
+
VALUE redcloth_transform2(VALUE, VALUE);
|
|
45
|
+
void red_inc(VALUE, VALUE);
|
|
46
|
+
VALUE red_block(VALUE, VALUE, VALUE, VALUE);
|
|
47
|
+
VALUE red_blockcode(VALUE, VALUE, VALUE);
|
|
48
|
+
VALUE red_pass(VALUE, VALUE, VALUE, ID, VALUE);
|
|
49
|
+
VALUE red_pass_code(VALUE, VALUE, VALUE, ID);
|
|
50
|
+
|
|
51
|
+
/* parser macros */
|
|
52
|
+
#define CLEAR_REGS() regs = rb_hash_new(); attr_regs = rb_hash_new();
|
|
53
|
+
#define RESET_REG() reg = NULL
|
|
54
|
+
#define MARK() reg = p;
|
|
55
|
+
#define MARK_B() bck = p;
|
|
56
|
+
#define MARK_ATTR() attr_reg = p;
|
|
57
|
+
#define CAT(H) rb_str_cat(H, ts, te-ts)
|
|
58
|
+
#define CLEAR(H) H = STR_NEW2("")
|
|
59
|
+
#define RSTRIP_BANG(H) rb_funcall(H, rb_intern("rstrip!"), 0)
|
|
60
|
+
#define SET_PLAIN_BLOCK(T) plain_block = STR_NEW2(T)
|
|
61
|
+
#define RESET_TYPE(T) rb_hash_aset(regs, ID2SYM(rb_intern("type")), plain_block)
|
|
62
|
+
#define INLINE(H, T) rb_str_append(H, rb_funcall(self, rb_intern(T), 1, regs))
|
|
63
|
+
#define DONE(H) rb_str_append(html, H); CLEAR(H); CLEAR_REGS()
|
|
64
|
+
#define PASS(H, A, T) rb_str_append(H, red_pass(self, regs, ID2SYM(rb_intern(A)), rb_intern(T), refs))
|
|
65
|
+
#define PARSE_ATTR(A) red_parse_attr(self, regs, ID2SYM(rb_intern(A)))
|
|
66
|
+
#define PARSE_LINK_ATTR(A) red_parse_link_attr(self, regs, ID2SYM(rb_intern(A)))
|
|
67
|
+
#define PARSE_IMAGE_ATTR(A) red_parse_image_attr(self, regs, ID2SYM(rb_intern(A)))
|
|
68
|
+
#define PASS_CODE(H, A, T) rb_str_append(H, red_pass_code(self, regs, ID2SYM(rb_intern(A)), rb_intern(T)))
|
|
69
|
+
#define ADD_BLOCK() \
|
|
70
|
+
rb_str_append(html, red_block(self, regs, block, refs)); \
|
|
71
|
+
extend = Qnil; \
|
|
72
|
+
CLEAR(block); \
|
|
73
|
+
CLEAR_REGS()
|
|
74
|
+
#define ADD_EXTENDED_BLOCK() rb_str_append(html, red_block(self, regs, block, refs)); CLEAR(block);
|
|
75
|
+
#define END_EXTENDED() extend = Qnil; CLEAR_REGS();
|
|
76
|
+
#define ADD_BLOCKCODE() rb_str_append(html, red_blockcode(self, regs, block)); CLEAR(block); CLEAR_REGS()
|
|
77
|
+
#define ADD_EXTENDED_BLOCKCODE() rb_str_append(html, red_blockcode(self, regs, block)); CLEAR(block);
|
|
78
|
+
#define ASET(T, V) rb_hash_aset(regs, ID2SYM(rb_intern(T)), STR_NEW2(V));
|
|
79
|
+
#define ATTR_SET(T, V) rb_hash_aset(attr_regs, ID2SYM(rb_intern(T)), STR_NEW2(V));
|
|
80
|
+
#define ATTR_INC(T) red_inc(attr_regs, ID2SYM(rb_intern(T)));
|
|
81
|
+
#define INC(N) N++;
|
|
82
|
+
#define SET_ATTRIBUTES() \
|
|
83
|
+
SET_ATTRIBUTE("class_buf", "class"); \
|
|
84
|
+
SET_ATTRIBUTE("id_buf", "id"); \
|
|
85
|
+
SET_ATTRIBUTE("lang_buf", "lang"); \
|
|
86
|
+
SET_ATTRIBUTE("style_buf", "style"); \
|
|
87
|
+
rb_funcall(regs, rb_intern("merge!"), 1, attr_regs); \
|
|
88
|
+
attr_regs = rb_hash_new();
|
|
89
|
+
#define SET_ATTRIBUTE(B, A) \
|
|
90
|
+
if (rb_hash_aref(regs, ID2SYM(rb_intern(B))) != Qnil) rb_hash_aset(regs, ID2SYM(rb_intern(A)), rb_hash_aref(regs, ID2SYM(rb_intern(B))));
|
|
91
|
+
#define TRANSFORM(T) \
|
|
92
|
+
if (p > reg && reg >= ts) { \
|
|
93
|
+
VALUE str = redcloth_transform(self, reg, p, refs); \
|
|
94
|
+
rb_hash_aset(regs, ID2SYM(rb_intern(T)), str); \
|
|
95
|
+
/*printf("TRANSFORM(" T ") '%s' (p:'%s' reg:'%s')\n", RSTRING_PTR(str), p, reg);*/ \
|
|
96
|
+
} else { \
|
|
97
|
+
rb_hash_aset(regs, ID2SYM(rb_intern(T)), Qnil); \
|
|
98
|
+
}
|
|
99
|
+
#define STORE(T) \
|
|
100
|
+
if (p > reg && reg >= ts) { \
|
|
101
|
+
VALUE str = STR_NEW(reg, p-reg); \
|
|
102
|
+
rb_hash_aset(regs, ID2SYM(rb_intern(T)), str); \
|
|
103
|
+
/*printf("STORE(" T ") '%s' (p:'%s' reg:'%s')\n", RSTRING_PTR(str), p, reg);*/ \
|
|
104
|
+
} else { \
|
|
105
|
+
rb_hash_aset(regs, ID2SYM(rb_intern(T)), Qnil); \
|
|
106
|
+
}
|
|
107
|
+
#define STORE_B(T) \
|
|
108
|
+
if (p > bck && bck >= ts) { \
|
|
109
|
+
VALUE str = STR_NEW(bck, p-bck); \
|
|
110
|
+
rb_hash_aset(regs, ID2SYM(rb_intern(T)), str); \
|
|
111
|
+
/*printf("STORE_B(" T ") '%s' (p:'%s' reg:'%s')\n", RSTRING_PTR(str), p, reg);*/ \
|
|
112
|
+
} else { \
|
|
113
|
+
rb_hash_aset(regs, ID2SYM(rb_intern(T)), Qnil); \
|
|
114
|
+
}
|
|
115
|
+
#define STORE_ATTR(T) \
|
|
116
|
+
if (p > attr_reg && attr_reg >= ts) { \
|
|
117
|
+
VALUE str = STR_NEW(attr_reg, p-attr_reg); \
|
|
118
|
+
rb_hash_aset(attr_regs, ID2SYM(rb_intern(T)), str); \
|
|
119
|
+
/*printf("STORE_B(" T ") '%s' (p:'%s' reg:'%s')\n", RSTRING_PTR(str), p, reg);*/ \
|
|
120
|
+
} else { \
|
|
121
|
+
rb_hash_aset(attr_regs, ID2SYM(rb_intern(T)), Qnil); \
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
#define STORE_URL(T) \
|
|
125
|
+
if (p > reg && reg >= ts) { \
|
|
126
|
+
char punct = 1; \
|
|
127
|
+
while (p > reg && punct == 1) { \
|
|
128
|
+
switch (*(p - 1)) { \
|
|
129
|
+
case ')': \
|
|
130
|
+
{ /*needed to keep inside chars scoped for less memory usage*/\
|
|
131
|
+
char *temp_p = p - 1; \
|
|
132
|
+
signed char level = -1; \
|
|
133
|
+
while (temp_p > reg) { \
|
|
134
|
+
switch(*(temp_p - 1)) { \
|
|
135
|
+
case '(': ++level; break; \
|
|
136
|
+
case ')': --level; break; \
|
|
137
|
+
} \
|
|
138
|
+
--temp_p; \
|
|
139
|
+
} \
|
|
140
|
+
if (level == 0) { punct = 0; } else { --p; } \
|
|
141
|
+
} \
|
|
142
|
+
break; \
|
|
143
|
+
case '!': case '"': case '#': case '$': case '%': case ']': case '[': case '&': case '\'': \
|
|
144
|
+
case '*': case '+': case ',': case '-': case '.': case '(': case ':': \
|
|
145
|
+
case ';': case '=': case '?': case '@': case '\\': case '^': case '_': \
|
|
146
|
+
case '`': case '|': case '~': p--; break; \
|
|
147
|
+
default: punct = 0; \
|
|
148
|
+
} \
|
|
149
|
+
} \
|
|
150
|
+
te = p; \
|
|
151
|
+
} \
|
|
152
|
+
STORE(T); \
|
|
153
|
+
if ( !NIL_P(refs) && rb_funcall(refs, rb_intern("has_key?"), 1, rb_hash_aref(regs, ID2SYM(rb_intern(T)))) ) { \
|
|
154
|
+
rb_hash_aset(regs, ID2SYM(rb_intern(T)), rb_hash_aref(refs, rb_hash_aref(regs, ID2SYM(rb_intern(T))))); \
|
|
155
|
+
}
|
|
156
|
+
#define STORE_LINK_ALIAS() \
|
|
157
|
+
rb_hash_aset(refs_found, rb_hash_aref(regs, ID2SYM(rb_intern("text"))), rb_hash_aref(regs, ID2SYM(rb_intern("href"))))
|
|
158
|
+
#define CLEAR_LIST() list_layout = rb_ary_new()
|
|
159
|
+
#define SET_LIST_TYPE(T) list_type = T;
|
|
160
|
+
#define NEST() nest ++;
|
|
161
|
+
#define RESET_NEST() nest = 0;
|
|
162
|
+
#define LIST_LAYOUT() \
|
|
163
|
+
int aint = 0; \
|
|
164
|
+
VALUE aval = rb_ary_entry(list_index, nest-1); \
|
|
165
|
+
if (aval != Qnil) aint = NUM2INT(aval); \
|
|
166
|
+
if (strcmp(list_type, "ol") == 0 && nest > 0) \
|
|
167
|
+
{ \
|
|
168
|
+
rb_ary_store(list_index, nest-1, INT2NUM(aint + 1)); \
|
|
169
|
+
} \
|
|
170
|
+
if (nest > RARRAY_LEN(list_layout)) \
|
|
171
|
+
{ \
|
|
172
|
+
SET_ATTRIBUTES(); \
|
|
173
|
+
sprintf(listm, "%s_open", list_type); \
|
|
174
|
+
if (!NIL_P(rb_hash_aref(regs, ID2SYM(rb_intern("list_continue"))))) \
|
|
175
|
+
{ \
|
|
176
|
+
rb_hash_aset(regs, ID2SYM(rb_intern("list_continue")), Qnil); \
|
|
177
|
+
rb_hash_aset(regs, ID2SYM(rb_intern("start")), rb_ary_entry(list_index, nest-1)); \
|
|
178
|
+
} \
|
|
179
|
+
else \
|
|
180
|
+
{ \
|
|
181
|
+
VALUE start = rb_hash_aref(regs, ID2SYM(rb_intern("start"))); \
|
|
182
|
+
if (NIL_P(start) ) \
|
|
183
|
+
{ \
|
|
184
|
+
rb_ary_store(list_index, nest-1, INT2NUM(1)); \
|
|
185
|
+
} \
|
|
186
|
+
else \
|
|
187
|
+
{ \
|
|
188
|
+
VALUE start_num = rb_funcall(start,rb_intern("to_i"),0); \
|
|
189
|
+
rb_ary_store(list_index, nest-1, start_num); \
|
|
190
|
+
} \
|
|
191
|
+
} \
|
|
192
|
+
rb_hash_aset(regs, ID2SYM(rb_intern("nest")), INT2NUM(nest)); \
|
|
193
|
+
rb_str_append(html, rb_funcall(self, rb_intern(listm), 1, regs)); \
|
|
194
|
+
rb_ary_store(list_layout, nest-1, STR_NEW2(list_type)); \
|
|
195
|
+
CLEAR_REGS(); \
|
|
196
|
+
ASET("first", "true"); \
|
|
197
|
+
} \
|
|
198
|
+
LIST_CLOSE(); \
|
|
199
|
+
if (nest != 0) LIST_ITEM_CLOSE(); \
|
|
200
|
+
CLEAR_REGS(); \
|
|
201
|
+
rb_hash_aset(regs, ID2SYM(rb_intern("nest")), INT2NUM(RARRAY_LEN(list_layout))); \
|
|
202
|
+
ASET("type", "li_open");
|
|
203
|
+
#define LIST_ITEM_CLOSE() \
|
|
204
|
+
if ( rb_hash_aref(regs, ID2SYM(rb_intern("first"))) == Qnil ) \
|
|
205
|
+
rb_str_append(html, rb_funcall(self, rb_intern("li_close"), 1, regs));
|
|
206
|
+
#define LIST_CLOSE() \
|
|
207
|
+
while (nest < RARRAY_LEN(list_layout)) \
|
|
208
|
+
{ \
|
|
209
|
+
rb_hash_aset(regs, ID2SYM(rb_intern("nest")), INT2NUM(RARRAY_LEN(list_layout))); \
|
|
210
|
+
VALUE end_list = rb_ary_pop(list_layout); \
|
|
211
|
+
if (!NIL_P(end_list)) \
|
|
212
|
+
{ \
|
|
213
|
+
StringValue(end_list); \
|
|
214
|
+
sprintf(listm, "%s_close", RSTRING_PTR(end_list)); \
|
|
215
|
+
LIST_ITEM_CLOSE(); \
|
|
216
|
+
rb_str_append(html, rb_funcall(self, rb_intern(listm), 1, regs)); \
|
|
217
|
+
} \
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
#endif
|
|
@@ -0,0 +1,650 @@
|
|
|
1
|
+
|
|
2
|
+
#line 1 "ragel/redcloth_attributes.c.rl"
|
|
3
|
+
/*
|
|
4
|
+
* redcloth_attributes.c.rl
|
|
5
|
+
*
|
|
6
|
+
* Copyright (C) 2009 Jason Garber
|
|
7
|
+
*/
|
|
8
|
+
#define RSTRING_NOT_MODIFIED
|
|
9
|
+
#include <ruby.h>
|
|
10
|
+
#include "redcloth.h"
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
#line 16 "ragel/redcloth_attributes.c.rl"
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
#line 18 "ext/redcloth_scan/redcloth_attributes.c"
|
|
18
|
+
static const char _redcloth_attributes_actions[] = {
|
|
19
|
+
0, 1, 2, 1, 4, 1, 5, 1,
|
|
20
|
+
6, 1, 7, 1, 8, 1, 11, 1,
|
|
21
|
+
12, 1, 13, 1, 15, 1, 18, 1,
|
|
22
|
+
19, 2, 3, 14, 2, 10, 17, 2,
|
|
23
|
+
13, 0, 2, 13, 1, 2, 13, 2,
|
|
24
|
+
2, 13, 5, 2, 13, 6, 2, 13,
|
|
25
|
+
7, 2, 13, 8, 3, 9, 10, 16
|
|
26
|
+
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
static const short _redcloth_attributes_key_offsets[] = {
|
|
30
|
+
0, 0, 6, 11, 27, 33, 38, 44,
|
|
31
|
+
60, 66, 87, 108, 118, 129, 137, 146,
|
|
32
|
+
153, 159, 164, 180, 201, 205, 210, 224,
|
|
33
|
+
240, 257, 274, 291, 304, 318, 325, 331,
|
|
34
|
+
346, 360, 375, 385, 391, 406, 420, 435,
|
|
35
|
+
445, 452, 462, 473, 492, 513, 535, 557,
|
|
36
|
+
579, 598, 618, 634, 650, 660, 671, 690,
|
|
37
|
+
711, 733, 755, 777, 796, 816, 819, 825,
|
|
38
|
+
840, 854, 869, 878, 888, 899, 918, 939,
|
|
39
|
+
961, 983, 1005, 1024, 1044
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
static const char _redcloth_attributes_trans_keys[] = {
|
|
43
|
+
0, 9, 10, 32, 11, 13, 0, 9,
|
|
44
|
+
32, 10, 13, 0, 9, 10, 32, 35,
|
|
45
|
+
41, 45, 95, 11, 13, 48, 57, 65,
|
|
46
|
+
90, 97, 122, 0, 9, 10, 32, 11,
|
|
47
|
+
13, 0, 9, 32, 10, 13, 0, 9,
|
|
48
|
+
10, 32, 11, 13, 0, 9, 10, 32,
|
|
49
|
+
35, 41, 45, 95, 11, 13, 48, 57,
|
|
50
|
+
65, 90, 97, 122, 0, 9, 10, 32,
|
|
51
|
+
11, 13, 0, 9, 10, 32, 95, 117,
|
|
52
|
+
125, 11, 13, 34, 35, 37, 39, 45,
|
|
53
|
+
46, 48, 59, 65, 90, 97, 122, 0,
|
|
54
|
+
9, 10, 32, 95, 117, 125, 11, 13,
|
|
55
|
+
34, 35, 37, 39, 45, 46, 48, 59,
|
|
56
|
+
65, 90, 97, 122, 32, 35, 45, 95,
|
|
57
|
+
48, 57, 65, 90, 97, 122, 32, 35,
|
|
58
|
+
41, 45, 95, 48, 57, 65, 90, 97,
|
|
59
|
+
122, 45, 95, 48, 57, 65, 90, 97,
|
|
60
|
+
122, 41, 45, 95, 48, 57, 65, 90,
|
|
61
|
+
97, 122, 0, 32, 40, 91, 123, 9,
|
|
62
|
+
13, 0, 9, 10, 32, 11, 13, 0,
|
|
63
|
+
9, 32, 10, 13, 0, 9, 10, 32,
|
|
64
|
+
35, 41, 45, 95, 11, 13, 48, 57,
|
|
65
|
+
65, 90, 97, 122, 0, 9, 10, 32,
|
|
66
|
+
95, 117, 125, 11, 13, 34, 35, 37,
|
|
67
|
+
39, 45, 46, 48, 59, 65, 90, 97,
|
|
68
|
+
122, 45, 95, 97, 122, 45, 93, 95,
|
|
69
|
+
97, 122, 32, 95, 34, 35, 37, 39,
|
|
70
|
+
45, 46, 48, 59, 65, 90, 97, 122,
|
|
71
|
+
32, 95, 117, 125, 34, 35, 37, 39,
|
|
72
|
+
45, 46, 48, 59, 65, 90, 97, 122,
|
|
73
|
+
32, 95, 114, 117, 125, 34, 35, 37,
|
|
74
|
+
39, 45, 46, 48, 59, 65, 90, 97,
|
|
75
|
+
122, 32, 95, 108, 117, 125, 34, 35,
|
|
76
|
+
37, 39, 45, 46, 48, 59, 65, 90,
|
|
77
|
+
97, 122, 32, 40, 95, 117, 125, 34,
|
|
78
|
+
35, 37, 39, 45, 46, 48, 59, 65,
|
|
79
|
+
90, 97, 122, 39, 43, 61, 92, 95,
|
|
80
|
+
34, 35, 45, 57, 63, 64, 97, 122,
|
|
81
|
+
39, 41, 43, 61, 92, 95, 34, 35,
|
|
82
|
+
45, 57, 63, 64, 97, 122, 0, 32,
|
|
83
|
+
40, 91, 123, 9, 13, 0, 9, 10,
|
|
84
|
+
32, 11, 13, 0, 9, 10, 32, 35,
|
|
85
|
+
45, 95, 11, 13, 48, 57, 65, 90,
|
|
86
|
+
97, 122, 0, 9, 10, 32, 45, 95,
|
|
87
|
+
11, 13, 48, 57, 65, 90, 97, 122,
|
|
88
|
+
0, 9, 10, 32, 41, 45, 95, 11,
|
|
89
|
+
13, 48, 57, 65, 90, 97, 122, 0,
|
|
90
|
+
9, 10, 32, 40, 46, 91, 123, 11,
|
|
91
|
+
13, 0, 9, 10, 32, 11, 13, 0,
|
|
92
|
+
9, 10, 32, 35, 45, 95, 11, 13,
|
|
93
|
+
48, 57, 65, 90, 97, 122, 0, 9,
|
|
94
|
+
10, 32, 45, 95, 11, 13, 48, 57,
|
|
95
|
+
65, 90, 97, 122, 0, 9, 10, 32,
|
|
96
|
+
41, 45, 95, 11, 13, 48, 57, 65,
|
|
97
|
+
90, 97, 122, 0, 9, 10, 32, 40,
|
|
98
|
+
46, 91, 123, 11, 13, 0, 9, 10,
|
|
99
|
+
32, 46, 11, 13, 0, 9, 10, 32,
|
|
100
|
+
45, 95, 11, 13, 97, 122, 0, 9,
|
|
101
|
+
10, 32, 45, 93, 95, 11, 13, 97,
|
|
102
|
+
122, 0, 9, 10, 32, 95, 11, 13,
|
|
103
|
+
34, 35, 37, 39, 45, 46, 48, 59,
|
|
104
|
+
65, 90, 97, 122, 0, 9, 10, 32,
|
|
105
|
+
95, 117, 125, 11, 13, 34, 35, 37,
|
|
106
|
+
39, 45, 46, 48, 59, 65, 90, 97,
|
|
107
|
+
122, 0, 9, 10, 32, 95, 114, 117,
|
|
108
|
+
125, 11, 13, 34, 35, 37, 39, 45,
|
|
109
|
+
46, 48, 59, 65, 90, 97, 122, 0,
|
|
110
|
+
9, 10, 32, 95, 108, 117, 125, 11,
|
|
111
|
+
13, 34, 35, 37, 39, 45, 46, 48,
|
|
112
|
+
59, 65, 90, 97, 122, 0, 9, 10,
|
|
113
|
+
32, 40, 95, 117, 125, 11, 13, 34,
|
|
114
|
+
35, 37, 39, 45, 46, 48, 59, 65,
|
|
115
|
+
90, 97, 122, 0, 9, 10, 32, 39,
|
|
116
|
+
43, 61, 92, 95, 11, 13, 34, 35,
|
|
117
|
+
45, 57, 63, 64, 97, 122, 0, 9,
|
|
118
|
+
10, 32, 39, 41, 43, 61, 92, 95,
|
|
119
|
+
11, 13, 34, 35, 45, 57, 63, 64,
|
|
120
|
+
97, 122, 0, 9, 10, 32, 35, 41,
|
|
121
|
+
45, 95, 11, 13, 48, 57, 65, 90,
|
|
122
|
+
97, 122, 0, 9, 10, 32, 35, 41,
|
|
123
|
+
45, 95, 11, 13, 48, 57, 65, 90,
|
|
124
|
+
97, 122, 0, 9, 10, 32, 45, 95,
|
|
125
|
+
11, 13, 97, 122, 0, 9, 10, 32,
|
|
126
|
+
45, 93, 95, 11, 13, 97, 122, 0,
|
|
127
|
+
9, 10, 32, 95, 11, 13, 34, 35,
|
|
128
|
+
37, 39, 45, 46, 48, 59, 65, 90,
|
|
129
|
+
97, 122, 0, 9, 10, 32, 95, 117,
|
|
130
|
+
125, 11, 13, 34, 35, 37, 39, 45,
|
|
131
|
+
46, 48, 59, 65, 90, 97, 122, 0,
|
|
132
|
+
9, 10, 32, 95, 114, 117, 125, 11,
|
|
133
|
+
13, 34, 35, 37, 39, 45, 46, 48,
|
|
134
|
+
59, 65, 90, 97, 122, 0, 9, 10,
|
|
135
|
+
32, 95, 108, 117, 125, 11, 13, 34,
|
|
136
|
+
35, 37, 39, 45, 46, 48, 59, 65,
|
|
137
|
+
90, 97, 122, 0, 9, 10, 32, 40,
|
|
138
|
+
95, 117, 125, 11, 13, 34, 35, 37,
|
|
139
|
+
39, 45, 46, 48, 59, 65, 90, 97,
|
|
140
|
+
122, 0, 9, 10, 32, 39, 43, 61,
|
|
141
|
+
92, 95, 11, 13, 34, 35, 45, 57,
|
|
142
|
+
63, 64, 97, 122, 0, 9, 10, 32,
|
|
143
|
+
39, 41, 43, 61, 92, 95, 11, 13,
|
|
144
|
+
34, 35, 45, 57, 63, 64, 97, 122,
|
|
145
|
+
40, 91, 123, 0, 9, 10, 32, 11,
|
|
146
|
+
13, 0, 9, 10, 32, 35, 45, 95,
|
|
147
|
+
11, 13, 48, 57, 65, 90, 97, 122,
|
|
148
|
+
0, 9, 10, 32, 45, 95, 11, 13,
|
|
149
|
+
48, 57, 65, 90, 97, 122, 0, 9,
|
|
150
|
+
10, 32, 41, 45, 95, 11, 13, 48,
|
|
151
|
+
57, 65, 90, 97, 122, 0, 9, 10,
|
|
152
|
+
32, 40, 91, 123, 11, 13, 0, 9,
|
|
153
|
+
10, 32, 45, 95, 11, 13, 97, 122,
|
|
154
|
+
0, 9, 10, 32, 45, 93, 95, 11,
|
|
155
|
+
13, 97, 122, 0, 9, 10, 32, 95,
|
|
156
|
+
11, 13, 34, 35, 37, 39, 45, 46,
|
|
157
|
+
48, 59, 65, 90, 97, 122, 0, 9,
|
|
158
|
+
10, 32, 95, 117, 125, 11, 13, 34,
|
|
159
|
+
35, 37, 39, 45, 46, 48, 59, 65,
|
|
160
|
+
90, 97, 122, 0, 9, 10, 32, 95,
|
|
161
|
+
114, 117, 125, 11, 13, 34, 35, 37,
|
|
162
|
+
39, 45, 46, 48, 59, 65, 90, 97,
|
|
163
|
+
122, 0, 9, 10, 32, 95, 108, 117,
|
|
164
|
+
125, 11, 13, 34, 35, 37, 39, 45,
|
|
165
|
+
46, 48, 59, 65, 90, 97, 122, 0,
|
|
166
|
+
9, 10, 32, 40, 95, 117, 125, 11,
|
|
167
|
+
13, 34, 35, 37, 39, 45, 46, 48,
|
|
168
|
+
59, 65, 90, 97, 122, 0, 9, 10,
|
|
169
|
+
32, 39, 43, 61, 92, 95, 11, 13,
|
|
170
|
+
34, 35, 45, 57, 63, 64, 97, 122,
|
|
171
|
+
0, 9, 10, 32, 39, 41, 43, 61,
|
|
172
|
+
92, 95, 11, 13, 34, 35, 45, 57,
|
|
173
|
+
63, 64, 97, 122, 0, 9, 10, 32,
|
|
174
|
+
35, 41, 45, 95, 11, 13, 48, 57,
|
|
175
|
+
65, 90, 97, 122, 0
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
static const char _redcloth_attributes_single_lengths[] = {
|
|
179
|
+
0, 4, 3, 8, 4, 3, 4, 8,
|
|
180
|
+
4, 7, 7, 4, 5, 2, 3, 5,
|
|
181
|
+
4, 3, 8, 7, 2, 3, 2, 4,
|
|
182
|
+
5, 5, 5, 5, 6, 5, 4, 7,
|
|
183
|
+
6, 7, 8, 4, 7, 6, 7, 8,
|
|
184
|
+
5, 6, 7, 5, 7, 8, 8, 8,
|
|
185
|
+
9, 10, 8, 8, 6, 7, 5, 7,
|
|
186
|
+
8, 8, 8, 9, 10, 3, 4, 7,
|
|
187
|
+
6, 7, 7, 6, 7, 5, 7, 8,
|
|
188
|
+
8, 8, 9, 10, 8
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
static const char _redcloth_attributes_range_lengths[] = {
|
|
192
|
+
0, 1, 1, 4, 1, 1, 1, 4,
|
|
193
|
+
1, 7, 7, 3, 3, 3, 3, 1,
|
|
194
|
+
1, 1, 4, 7, 1, 1, 6, 6,
|
|
195
|
+
6, 6, 6, 4, 4, 1, 1, 4,
|
|
196
|
+
4, 4, 1, 1, 4, 4, 4, 1,
|
|
197
|
+
1, 2, 2, 7, 7, 7, 7, 7,
|
|
198
|
+
5, 5, 4, 4, 2, 2, 7, 7,
|
|
199
|
+
7, 7, 7, 5, 5, 0, 1, 4,
|
|
200
|
+
4, 4, 1, 2, 2, 7, 7, 7,
|
|
201
|
+
7, 7, 5, 5, 4
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
static const short _redcloth_attributes_index_offsets[] = {
|
|
205
|
+
0, 0, 6, 11, 24, 30, 35, 41,
|
|
206
|
+
54, 60, 75, 90, 98, 107, 113, 120,
|
|
207
|
+
127, 133, 138, 151, 166, 170, 175, 184,
|
|
208
|
+
195, 207, 219, 231, 241, 252, 259, 265,
|
|
209
|
+
277, 288, 300, 310, 316, 328, 339, 351,
|
|
210
|
+
361, 368, 377, 387, 400, 415, 431, 447,
|
|
211
|
+
463, 478, 494, 507, 520, 529, 539, 552,
|
|
212
|
+
567, 583, 599, 615, 630, 646, 650, 656,
|
|
213
|
+
668, 679, 691, 700, 709, 719, 732, 747,
|
|
214
|
+
763, 779, 795, 810, 826
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
static const char _redcloth_attributes_indicies[] = {
|
|
218
|
+
0, 2, 3, 2, 0, 1, 0, 2,
|
|
219
|
+
2, 0, 1, 0, 2, 3, 4, 5,
|
|
220
|
+
6, 7, 7, 0, 7, 7, 7, 1,
|
|
221
|
+
8, 10, 11, 10, 8, 9, 8, 10,
|
|
222
|
+
10, 8, 9, 0, 2, 3, 13, 0,
|
|
223
|
+
12, 8, 10, 11, 14, 15, 16, 17,
|
|
224
|
+
17, 8, 17, 17, 17, 9, 8, 10,
|
|
225
|
+
11, 18, 8, 12, 8, 10, 11, 19,
|
|
226
|
+
20, 21, 22, 8, 20, 20, 20, 20,
|
|
227
|
+
20, 20, 9, 0, 2, 3, 23, 24,
|
|
228
|
+
25, 26, 0, 24, 24, 24, 24, 24,
|
|
229
|
+
24, 1, 27, 29, 27, 27, 27, 27,
|
|
230
|
+
27, 28, 30, 31, 32, 30, 30, 30,
|
|
231
|
+
30, 30, 28, 33, 33, 33, 33, 33,
|
|
232
|
+
28, 34, 35, 35, 35, 35, 35, 28,
|
|
233
|
+
28, 28, 37, 38, 39, 28, 36, 40,
|
|
234
|
+
42, 43, 42, 40, 41, 40, 42, 42,
|
|
235
|
+
40, 41, 40, 42, 43, 44, 45, 46,
|
|
236
|
+
47, 47, 40, 47, 47, 47, 41, 40,
|
|
237
|
+
42, 43, 48, 49, 50, 51, 40, 49,
|
|
238
|
+
49, 49, 49, 49, 49, 41, 52, 52,
|
|
239
|
+
52, 28, 53, 54, 53, 53, 28, 55,
|
|
240
|
+
55, 55, 55, 55, 55, 55, 55, 28,
|
|
241
|
+
56, 56, 57, 58, 56, 56, 56, 56,
|
|
242
|
+
56, 56, 28, 56, 56, 59, 57, 58,
|
|
243
|
+
56, 56, 56, 56, 56, 56, 28, 56,
|
|
244
|
+
56, 60, 57, 58, 56, 56, 56, 56,
|
|
245
|
+
56, 56, 28, 56, 61, 56, 57, 58,
|
|
246
|
+
56, 56, 56, 56, 56, 56, 28, 62,
|
|
247
|
+
62, 62, 62, 62, 62, 62, 62, 62,
|
|
248
|
+
28, 62, 56, 62, 62, 62, 62, 62,
|
|
249
|
+
62, 62, 62, 28, 28, 28, 64, 65,
|
|
250
|
+
66, 28, 63, 67, 2, 3, 2, 67,
|
|
251
|
+
1, 67, 2, 3, 68, 69, 70, 70,
|
|
252
|
+
67, 70, 70, 70, 1, 67, 2, 3,
|
|
253
|
+
2, 71, 71, 67, 71, 71, 71, 1,
|
|
254
|
+
67, 2, 3, 2, 72, 73, 73, 67,
|
|
255
|
+
73, 73, 73, 1, 67, 2, 3, 13,
|
|
256
|
+
74, 75, 76, 77, 67, 12, 78, 10,
|
|
257
|
+
11, 10, 78, 9, 78, 10, 11, 79,
|
|
258
|
+
80, 81, 81, 78, 81, 81, 81, 9,
|
|
259
|
+
78, 10, 11, 10, 82, 82, 78, 82,
|
|
260
|
+
82, 82, 9, 78, 10, 11, 10, 83,
|
|
261
|
+
84, 84, 78, 84, 84, 84, 9, 78,
|
|
262
|
+
10, 11, 18, 74, 75, 76, 77, 78,
|
|
263
|
+
12, 78, 10, 11, 18, 75, 78, 12,
|
|
264
|
+
78, 10, 11, 10, 85, 85, 78, 85,
|
|
265
|
+
9, 78, 10, 11, 10, 86, 87, 86,
|
|
266
|
+
78, 86, 9, 78, 10, 11, 88, 89,
|
|
267
|
+
78, 89, 89, 89, 89, 89, 89, 9,
|
|
268
|
+
78, 10, 11, 19, 20, 21, 22, 78,
|
|
269
|
+
20, 20, 20, 20, 20, 20, 9, 78,
|
|
270
|
+
10, 11, 19, 20, 90, 21, 22, 78,
|
|
271
|
+
20, 20, 20, 20, 20, 20, 9, 78,
|
|
272
|
+
10, 11, 19, 20, 91, 21, 22, 78,
|
|
273
|
+
20, 20, 20, 20, 20, 20, 9, 78,
|
|
274
|
+
10, 11, 19, 92, 20, 21, 22, 78,
|
|
275
|
+
20, 20, 20, 20, 20, 20, 9, 78,
|
|
276
|
+
10, 11, 10, 93, 93, 93, 93, 93,
|
|
277
|
+
78, 93, 93, 93, 93, 9, 78, 10,
|
|
278
|
+
11, 10, 93, 20, 93, 93, 93, 93,
|
|
279
|
+
78, 93, 93, 93, 93, 9, 78, 10,
|
|
280
|
+
11, 14, 15, 16, 17, 17, 78, 17,
|
|
281
|
+
17, 17, 9, 67, 2, 3, 4, 5,
|
|
282
|
+
6, 7, 7, 67, 7, 7, 7, 1,
|
|
283
|
+
67, 2, 3, 2, 94, 94, 67, 94,
|
|
284
|
+
1, 67, 2, 3, 2, 95, 96, 95,
|
|
285
|
+
67, 95, 1, 67, 2, 3, 97, 98,
|
|
286
|
+
67, 98, 98, 98, 98, 98, 98, 1,
|
|
287
|
+
67, 2, 3, 23, 24, 25, 26, 67,
|
|
288
|
+
24, 24, 24, 24, 24, 24, 1, 67,
|
|
289
|
+
2, 3, 23, 24, 99, 25, 26, 67,
|
|
290
|
+
24, 24, 24, 24, 24, 24, 1, 67,
|
|
291
|
+
2, 3, 23, 24, 100, 25, 26, 67,
|
|
292
|
+
24, 24, 24, 24, 24, 24, 1, 67,
|
|
293
|
+
2, 3, 23, 101, 24, 25, 26, 67,
|
|
294
|
+
24, 24, 24, 24, 24, 24, 1, 67,
|
|
295
|
+
2, 3, 2, 102, 102, 102, 102, 102,
|
|
296
|
+
67, 102, 102, 102, 102, 1, 67, 2,
|
|
297
|
+
3, 2, 102, 24, 102, 102, 102, 102,
|
|
298
|
+
67, 102, 102, 102, 102, 1, 103, 104,
|
|
299
|
+
105, 28, 106, 42, 43, 42, 106, 41,
|
|
300
|
+
106, 42, 43, 107, 108, 109, 109, 106,
|
|
301
|
+
109, 109, 109, 41, 106, 42, 43, 42,
|
|
302
|
+
110, 110, 106, 110, 110, 110, 41, 106,
|
|
303
|
+
42, 43, 42, 111, 112, 112, 106, 112,
|
|
304
|
+
112, 112, 41, 106, 42, 43, 42, 37,
|
|
305
|
+
38, 39, 106, 36, 106, 42, 43, 42,
|
|
306
|
+
113, 113, 106, 113, 41, 106, 42, 43,
|
|
307
|
+
42, 114, 115, 114, 106, 114, 41, 106,
|
|
308
|
+
42, 43, 116, 117, 106, 117, 117, 117,
|
|
309
|
+
117, 117, 117, 41, 106, 42, 43, 48,
|
|
310
|
+
49, 50, 51, 106, 49, 49, 49, 49,
|
|
311
|
+
49, 49, 41, 106, 42, 43, 48, 49,
|
|
312
|
+
118, 50, 51, 106, 49, 49, 49, 49,
|
|
313
|
+
49, 49, 41, 106, 42, 43, 48, 49,
|
|
314
|
+
119, 50, 51, 106, 49, 49, 49, 49,
|
|
315
|
+
49, 49, 41, 106, 42, 43, 48, 120,
|
|
316
|
+
49, 50, 51, 106, 49, 49, 49, 49,
|
|
317
|
+
49, 49, 41, 106, 42, 43, 42, 121,
|
|
318
|
+
121, 121, 121, 121, 106, 121, 121, 121,
|
|
319
|
+
121, 41, 106, 42, 43, 42, 121, 49,
|
|
320
|
+
121, 121, 121, 121, 106, 121, 121, 121,
|
|
321
|
+
121, 41, 106, 42, 43, 44, 45, 46,
|
|
322
|
+
47, 47, 106, 47, 47, 47, 41, 0
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
static const char _redcloth_attributes_trans_targs[] = {
|
|
326
|
+
29, 30, 1, 2, 3, 32, 34, 51,
|
|
327
|
+
29, 35, 4, 5, 35, 6, 7, 37,
|
|
328
|
+
39, 50, 8, 9, 44, 45, 39, 10,
|
|
329
|
+
55, 56, 34, 12, 0, 13, 12, 13,
|
|
330
|
+
15, 14, 15, 14, 62, 63, 67, 69,
|
|
331
|
+
61, 62, 16, 17, 18, 64, 66, 76,
|
|
332
|
+
19, 70, 71, 66, 21, 21, 15, 23,
|
|
333
|
+
23, 24, 15, 25, 26, 27, 28, 30,
|
|
334
|
+
31, 52, 54, 29, 3, 32, 51, 33,
|
|
335
|
+
34, 33, 36, 40, 41, 43, 29, 7,
|
|
336
|
+
37, 50, 38, 39, 38, 42, 42, 39,
|
|
337
|
+
9, 44, 46, 47, 48, 49, 53, 53,
|
|
338
|
+
34, 10, 55, 57, 58, 59, 60, 11,
|
|
339
|
+
20, 22, 61, 18, 64, 76, 65, 66,
|
|
340
|
+
65, 68, 68, 66, 19, 70, 72, 73,
|
|
341
|
+
74, 75
|
|
342
|
+
};
|
|
343
|
+
|
|
344
|
+
static const char _redcloth_attributes_trans_actions[] = {
|
|
345
|
+
23, 17, 0, 0, 0, 40, 40, 17,
|
|
346
|
+
21, 17, 0, 0, 31, 0, 0, 40,
|
|
347
|
+
40, 17, 0, 0, 17, 17, 49, 0,
|
|
348
|
+
17, 17, 49, 1, 0, 0, 0, 5,
|
|
349
|
+
5, 1, 7, 0, 31, 31, 31, 31,
|
|
350
|
+
19, 17, 0, 0, 0, 40, 40, 17,
|
|
351
|
+
0, 17, 17, 49, 1, 0, 9, 1,
|
|
352
|
+
0, 0, 11, 0, 0, 0, 0, 34,
|
|
353
|
+
34, 34, 34, 28, 1, 17, 37, 37,
|
|
354
|
+
43, 17, 31, 31, 31, 31, 52, 1,
|
|
355
|
+
17, 37, 37, 43, 17, 37, 17, 46,
|
|
356
|
+
1, 37, 17, 17, 17, 17, 37, 17,
|
|
357
|
+
46, 1, 37, 17, 17, 17, 17, 3,
|
|
358
|
+
3, 3, 25, 1, 17, 37, 37, 43,
|
|
359
|
+
17, 37, 17, 46, 1, 37, 17, 17,
|
|
360
|
+
17, 17
|
|
361
|
+
};
|
|
362
|
+
|
|
363
|
+
static const char _redcloth_attributes_to_state_actions[] = {
|
|
364
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
|
365
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
|
366
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
|
367
|
+
0, 0, 0, 0, 0, 13, 0, 0,
|
|
368
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
|
369
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
|
370
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
|
371
|
+
0, 0, 0, 0, 0, 13, 0, 0,
|
|
372
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
|
373
|
+
0, 0, 0, 0, 0
|
|
374
|
+
};
|
|
375
|
+
|
|
376
|
+
static const char _redcloth_attributes_from_state_actions[] = {
|
|
377
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
|
378
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
|
379
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
|
380
|
+
0, 0, 0, 0, 0, 15, 0, 0,
|
|
381
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
|
382
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
|
383
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
|
384
|
+
0, 0, 0, 0, 0, 15, 0, 0,
|
|
385
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
|
386
|
+
0, 0, 0, 0, 0
|
|
387
|
+
};
|
|
388
|
+
|
|
389
|
+
static const short _redcloth_attributes_eof_trans[] = {
|
|
390
|
+
0, 1, 1, 1, 9, 9, 1, 9,
|
|
391
|
+
9, 9, 1, 0, 0, 0, 0, 0,
|
|
392
|
+
41, 41, 41, 41, 0, 0, 0, 0,
|
|
393
|
+
0, 0, 0, 0, 0, 0, 68, 68,
|
|
394
|
+
68, 68, 68, 79, 79, 79, 79, 79,
|
|
395
|
+
79, 79, 79, 79, 79, 79, 79, 79,
|
|
396
|
+
79, 79, 79, 68, 68, 68, 68, 68,
|
|
397
|
+
68, 68, 68, 68, 68, 0, 107, 107,
|
|
398
|
+
107, 107, 107, 107, 107, 107, 107, 107,
|
|
399
|
+
107, 107, 107, 107, 107
|
|
400
|
+
};
|
|
401
|
+
|
|
402
|
+
static const int redcloth_attributes_start = 29;
|
|
403
|
+
static const int redcloth_attributes_error = 0;
|
|
404
|
+
|
|
405
|
+
static const int redcloth_attributes_en_inline = 61;
|
|
406
|
+
static const int redcloth_attributes_en_link_says = 29;
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
#line 19 "ragel/redcloth_attributes.c.rl"
|
|
410
|
+
|
|
411
|
+
|
|
412
|
+
VALUE
|
|
413
|
+
redcloth_attribute_parser(machine, self, p, pe)
|
|
414
|
+
int machine;
|
|
415
|
+
VALUE self;
|
|
416
|
+
char *p, *pe;
|
|
417
|
+
{
|
|
418
|
+
int cs, act;
|
|
419
|
+
char *ts = 0, *te = 0, *reg = 0, *bck = NULL, *attr_reg = NULL, *eof = NULL;
|
|
420
|
+
VALUE regs = rb_hash_new();
|
|
421
|
+
VALUE attr_regs = rb_hash_new();
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
#line 425 "ext/redcloth_scan/redcloth_attributes.c"
|
|
425
|
+
{
|
|
426
|
+
cs = redcloth_attributes_start;
|
|
427
|
+
ts = 0;
|
|
428
|
+
te = 0;
|
|
429
|
+
act = 0;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
#line 33 "ragel/redcloth_attributes.c.rl"
|
|
433
|
+
|
|
434
|
+
cs = machine;
|
|
435
|
+
|
|
436
|
+
|
|
437
|
+
#line 438 "ext/redcloth_scan/redcloth_attributes.c"
|
|
438
|
+
{
|
|
439
|
+
int _klen;
|
|
440
|
+
unsigned int _trans;
|
|
441
|
+
const char *_acts;
|
|
442
|
+
unsigned int _nacts;
|
|
443
|
+
const char *_keys;
|
|
444
|
+
|
|
445
|
+
if ( p == pe )
|
|
446
|
+
goto _test_eof;
|
|
447
|
+
if ( cs == 0 )
|
|
448
|
+
goto _out;
|
|
449
|
+
_resume:
|
|
450
|
+
_acts = _redcloth_attributes_actions + _redcloth_attributes_from_state_actions[cs];
|
|
451
|
+
_nacts = (unsigned int) *_acts++;
|
|
452
|
+
while ( _nacts-- > 0 ) {
|
|
453
|
+
switch ( *_acts++ ) {
|
|
454
|
+
case 12:
|
|
455
|
+
#line 1 "NONE"
|
|
456
|
+
{ts = p;}
|
|
457
|
+
break;
|
|
458
|
+
#line 459 "ext/redcloth_scan/redcloth_attributes.c"
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
_keys = _redcloth_attributes_trans_keys + _redcloth_attributes_key_offsets[cs];
|
|
463
|
+
_trans = _redcloth_attributes_index_offsets[cs];
|
|
464
|
+
|
|
465
|
+
_klen = _redcloth_attributes_single_lengths[cs];
|
|
466
|
+
if ( _klen > 0 ) {
|
|
467
|
+
const char *_lower = _keys;
|
|
468
|
+
const char *_mid;
|
|
469
|
+
const char *_upper = _keys + _klen - 1;
|
|
470
|
+
while (1) {
|
|
471
|
+
if ( _upper < _lower )
|
|
472
|
+
break;
|
|
473
|
+
|
|
474
|
+
_mid = _lower + ((_upper-_lower) >> 1);
|
|
475
|
+
if ( (*p) < *_mid )
|
|
476
|
+
_upper = _mid - 1;
|
|
477
|
+
else if ( (*p) > *_mid )
|
|
478
|
+
_lower = _mid + 1;
|
|
479
|
+
else {
|
|
480
|
+
_trans += (unsigned int)(_mid - _keys);
|
|
481
|
+
goto _match;
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
_keys += _klen;
|
|
485
|
+
_trans += _klen;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
_klen = _redcloth_attributes_range_lengths[cs];
|
|
489
|
+
if ( _klen > 0 ) {
|
|
490
|
+
const char *_lower = _keys;
|
|
491
|
+
const char *_mid;
|
|
492
|
+
const char *_upper = _keys + (_klen<<1) - 2;
|
|
493
|
+
while (1) {
|
|
494
|
+
if ( _upper < _lower )
|
|
495
|
+
break;
|
|
496
|
+
|
|
497
|
+
_mid = _lower + (((_upper-_lower) >> 1) & ~1);
|
|
498
|
+
if ( (*p) < _mid[0] )
|
|
499
|
+
_upper = _mid - 2;
|
|
500
|
+
else if ( (*p) > _mid[1] )
|
|
501
|
+
_lower = _mid + 2;
|
|
502
|
+
else {
|
|
503
|
+
_trans += (unsigned int)((_mid - _keys)>>1);
|
|
504
|
+
goto _match;
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
_trans += _klen;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
_match:
|
|
511
|
+
_trans = _redcloth_attributes_indicies[_trans];
|
|
512
|
+
_eof_trans:
|
|
513
|
+
cs = _redcloth_attributes_trans_targs[_trans];
|
|
514
|
+
|
|
515
|
+
if ( _redcloth_attributes_trans_actions[_trans] == 0 )
|
|
516
|
+
goto _again;
|
|
517
|
+
|
|
518
|
+
_acts = _redcloth_attributes_actions + _redcloth_attributes_trans_actions[_trans];
|
|
519
|
+
_nacts = (unsigned int) *_acts++;
|
|
520
|
+
while ( _nacts-- > 0 )
|
|
521
|
+
{
|
|
522
|
+
switch ( *_acts++ )
|
|
523
|
+
{
|
|
524
|
+
case 0:
|
|
525
|
+
#line 5 "ragel/redcloth_common.rl"
|
|
526
|
+
{ MARK(); }
|
|
527
|
+
break;
|
|
528
|
+
case 1:
|
|
529
|
+
#line 6 "ragel/redcloth_common.rl"
|
|
530
|
+
{ MARK_B(); }
|
|
531
|
+
break;
|
|
532
|
+
case 2:
|
|
533
|
+
#line 7 "ragel/redcloth_common.rl"
|
|
534
|
+
{ MARK_ATTR(); }
|
|
535
|
+
break;
|
|
536
|
+
case 3:
|
|
537
|
+
#line 9 "ragel/redcloth_common.rl"
|
|
538
|
+
{ STORE("text"); }
|
|
539
|
+
break;
|
|
540
|
+
case 4:
|
|
541
|
+
#line 10 "ragel/redcloth_common.rl"
|
|
542
|
+
{ CLEAR_REGS(); RESET_REG(); }
|
|
543
|
+
break;
|
|
544
|
+
case 5:
|
|
545
|
+
#line 35 "ragel/redcloth_common.rl"
|
|
546
|
+
{ STORE_ATTR("class"); }
|
|
547
|
+
break;
|
|
548
|
+
case 6:
|
|
549
|
+
#line 36 "ragel/redcloth_common.rl"
|
|
550
|
+
{ STORE_ATTR("id"); }
|
|
551
|
+
break;
|
|
552
|
+
case 7:
|
|
553
|
+
#line 38 "ragel/redcloth_common.rl"
|
|
554
|
+
{ STORE_ATTR("lang"); }
|
|
555
|
+
break;
|
|
556
|
+
case 8:
|
|
557
|
+
#line 39 "ragel/redcloth_common.rl"
|
|
558
|
+
{ STORE_ATTR("style"); }
|
|
559
|
+
break;
|
|
560
|
+
case 9:
|
|
561
|
+
#line 20 "ragel/redcloth_attributes.rl"
|
|
562
|
+
{ STORE("name"); }
|
|
563
|
+
break;
|
|
564
|
+
case 10:
|
|
565
|
+
#line 21 "ragel/redcloth_attributes.rl"
|
|
566
|
+
{ STORE_B("name_without_attributes"); }
|
|
567
|
+
break;
|
|
568
|
+
case 13:
|
|
569
|
+
#line 1 "NONE"
|
|
570
|
+
{te = p+1;}
|
|
571
|
+
break;
|
|
572
|
+
case 14:
|
|
573
|
+
#line 16 "ragel/redcloth_attributes.rl"
|
|
574
|
+
{te = p;p--;{ SET_ATTRIBUTES(); }}
|
|
575
|
+
break;
|
|
576
|
+
case 15:
|
|
577
|
+
#line 16 "ragel/redcloth_attributes.rl"
|
|
578
|
+
{{p = ((te))-1;}{ SET_ATTRIBUTES(); }}
|
|
579
|
+
break;
|
|
580
|
+
case 16:
|
|
581
|
+
#line 25 "ragel/redcloth_attributes.rl"
|
|
582
|
+
{te = p;p--;{ SET_ATTRIBUTES(); }}
|
|
583
|
+
break;
|
|
584
|
+
case 17:
|
|
585
|
+
#line 26 "ragel/redcloth_attributes.rl"
|
|
586
|
+
{te = p;p--;{ SET_ATTRIBUTE("name_without_attributes", "name"); }}
|
|
587
|
+
break;
|
|
588
|
+
case 18:
|
|
589
|
+
#line 25 "ragel/redcloth_attributes.rl"
|
|
590
|
+
{{p = ((te))-1;}{ SET_ATTRIBUTES(); }}
|
|
591
|
+
break;
|
|
592
|
+
case 19:
|
|
593
|
+
#line 26 "ragel/redcloth_attributes.rl"
|
|
594
|
+
{{p = ((te))-1;}{ SET_ATTRIBUTE("name_without_attributes", "name"); }}
|
|
595
|
+
break;
|
|
596
|
+
#line 597 "ext/redcloth_scan/redcloth_attributes.c"
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
_again:
|
|
601
|
+
_acts = _redcloth_attributes_actions + _redcloth_attributes_to_state_actions[cs];
|
|
602
|
+
_nacts = (unsigned int) *_acts++;
|
|
603
|
+
while ( _nacts-- > 0 ) {
|
|
604
|
+
switch ( *_acts++ ) {
|
|
605
|
+
case 11:
|
|
606
|
+
#line 1 "NONE"
|
|
607
|
+
{ts = 0;}
|
|
608
|
+
break;
|
|
609
|
+
#line 610 "ext/redcloth_scan/redcloth_attributes.c"
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
if ( cs == 0 )
|
|
614
|
+
goto _out;
|
|
615
|
+
if ( ++p != pe )
|
|
616
|
+
goto _resume;
|
|
617
|
+
_test_eof: {}
|
|
618
|
+
if ( p == eof )
|
|
619
|
+
{
|
|
620
|
+
if ( _redcloth_attributes_eof_trans[cs] > 0 ) {
|
|
621
|
+
_trans = _redcloth_attributes_eof_trans[cs] - 1;
|
|
622
|
+
goto _eof_trans;
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
_out: {}
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
#line 37 "ragel/redcloth_attributes.c.rl"
|
|
630
|
+
|
|
631
|
+
return regs;
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
VALUE
|
|
635
|
+
redcloth_attributes(self, str)
|
|
636
|
+
VALUE self, str;
|
|
637
|
+
{
|
|
638
|
+
StringValue(str);
|
|
639
|
+
int cs = redcloth_attributes_en_inline;
|
|
640
|
+
return redcloth_attribute_parser(cs, self, RSTRING_PTR(str), RSTRING_PTR(str) + RSTRING_LEN(str) + 1);
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
VALUE
|
|
644
|
+
redcloth_link_attributes(self, str)
|
|
645
|
+
VALUE self, str;
|
|
646
|
+
{
|
|
647
|
+
StringValue(str);
|
|
648
|
+
int cs = redcloth_attributes_en_link_says;
|
|
649
|
+
return redcloth_attribute_parser(cs, self, RSTRING_PTR(str), RSTRING_PTR(str) + RSTRING_LEN(str) + 1);
|
|
650
|
+
}
|