6 # whitespace, non-printables
9 newline = ('\r\n' | '\n' | '\f' | '\r' when { p+1 < pe && *(p+1) != '\n' });
10 escaped_newline = '\\' newline;
11 nonnewline = any - [\r\n\f];
12 nonprintable_char = cntrl - [\r\n\f];
16 hex_num = 0 [xX] [a-fA-F0-9]+;
18 integer = [+\-]? (hex_num | oct_num | dec_num);
19 float = [+\-]? ((digit* '.' digit+) | (digit+ '.' digit*) | digit+)
23 sq_str = '\'' [^']* '\'';
24 dq_str = '"' [^"]* '"';
25 sq_str_with_escapes = '\'' ([^'\\] | '\\' any)* '\'';
26 dq_str_with_escapes = '"' ([^"\\] | '\\' any)* '"';
32 if (callback_list_head) free_queue(); // free the current queue
33 callback_list_head = NULL;
34 callback_list_tail = NULL;
35 // set backup variables
36 last_line_start = line_start;
37 last_line_contains_code = line_contains_code;
38 last_whole_line_comment = whole_line_comment;
44 for (item = callback_list_head; item != NULL; item = item->next)
45 callback(item->lang, item->entity, item->s, item->e, item->udata);
51 action ls { if (!line_start) line_start = ts; }
54 if (!line_contains_code && !line_start) line_start = ts;
55 line_contains_code = 1;
59 if (!line_contains_code) {
60 whole_line_comment = 1;
61 if (!line_start) line_start = ts;
65 action check_blank_outry {
66 if (!line_contains_code && !whole_line_comment) seen = 0;
71 action no_code { !line_contains_code }
72 action no_comment { !whole_line_comment }
73 action no_code_or_comment { !line_contains_code && !whole_line_comment }
76 p == buffer || *(p-1) == '\r' || *(p-1) == '\n' || *(p-1) == '\f'
79 p == buffer || *(p-2) == '\r' || *(p-2) == '\n' || *(p-2) == '\f'