54 |
} else if (traits_type::eq (c, ct.widen ('\t'))) { |
} else if (traits_type::eq (c, ct.widen ('\t'))) { |
55 |
token_column += tab_size; |
token_column += tab_size; |
56 |
state = 0; |
state = 0; |
57 |
} else if (traits_type::eq (c, ct.widen ('\n'))) { |
} else if (traits_type::eq_int_type (c, ct.widen ('\n'))) { |
58 |
token_value.push_back (c); |
token_value.push_back (c); |
59 |
return token (token::type_endl, token_value, token_line, token_column); |
return token (token::type_endl, token_value, token_line, token_column); |
60 |
} else if (traits_type::eq (c, ct.widen (';'))) { |
} else if (traits_type::eq (c, ct.widen (';'))) { |
85 |
} else if (traits_type::eq (c, ct.widen ('\\'))) { |
} else if (traits_type::eq (c, ct.widen ('\\'))) { |
86 |
++token_column; |
++token_column; |
87 |
state = 9; |
state = 9; |
88 |
|
} else if (traits_type::eq (c, ct.widen ('#'))) { |
89 |
|
++token_column; |
90 |
|
state = 10; |
91 |
} else if (traits_type::eq_int_type (c, traits_type::eof ())) { |
} else if (traits_type::eq_int_type (c, traits_type::eof ())) { |
92 |
return token (token::type_eof, token_value, token_line, token_column); |
return token (token::type_eof, token_value, token_line, token_column); |
93 |
} else { |
} else { |
182 |
} else { |
} else { |
183 |
ecstacy::util::throw_exception (failure ("invalid \\ character")); |
ecstacy::util::throw_exception (failure ("invalid \\ character")); |
184 |
} |
} |
185 |
|
break; |
186 |
|
case 10: |
187 |
|
// comment |
188 |
|
if (traits_type::eq_int_type (c, ct.widen ('\n'))) { |
189 |
|
token_value.push_back (c); |
190 |
|
return token (token::type_endl, token_value, token_line, token_column); |
191 |
|
} else { |
192 |
|
state = 10; |
193 |
|
} |
194 |
|
break; |
195 |
default: |
default: |
196 |
// shouldn't ever get here |
// shouldn't ever get here |
197 |
ecstacy::util::throw_exception (std::logic_error ("what the fuck?!?")); |
ecstacy::util::throw_exception (std::logic_error ("invalid lexer state")); |
198 |
} |
} |
199 |
} |
} |
200 |
} |
} |