Yet another C++ colorizer...
Oct. 15th, 2005 05:37http://www.chami.com/colorizer/
И он опять не проходит простые тесты.
На комментарии, на литералы.
Даже безо всяких триграфов.
via
__ak__
И он опять не проходит простые тесты.
На комментарии, на литералы.
Даже безо всяких триграфов.
// Вырезка из набора простых boundary test cases парсера C++ комментариев
#include <iostream>
int main()
{
// Константы
std::cout << "C1. This is /* not a comment */\n";
std::cout << "C2. This is // not a comment\n";
std::cout << "C3. This is \" /* not a comment as well*/ \"\n";
std::cout << "C4. This is \" // not a comment as well \"\n";
std::cout << "C5. Let's print some random numbers: " << '/*' << '*/' << '\n';
std::cout << "C6. Let's print a random number: " << '//' << '\n';
std::cout << "C7. This is\" '/*' not a comment '*/' \"\n";
std::cout << "C8. This is\" '//' not a comment \"\n";
// Конец строки
std::cout << "F5. This is "
// line-continuation character: \
"SOMETHING ERRONEOUS BUT" // */
" not a comment\n";
// Триграфы + конец строки
std::cout << "H5. This is obviously "
// Триграфы?! - это что такое???????/
"SOMETHING ERRONEOUS BUT"
" not a comment\n";
// Триграфы + константы
#ifndef __GNUC__ // gcc up to 3.2.3 fails to handle trigraphs in these contexts
std::cout << "J1. This is ??/" /* not a comment */ ??/"\n";
std::cout << "J2. This is ??/" // not a comment at all */ ??/"\n";
std::cout << "??/" '??/' '/*J3. Yeah, baby, this is NOT a comment*/' ??/"\n";
#endif
}
via
no subject
Date: Oct. 15th, 2005 06:06 (UTC)no subject
Date: Oct. 15th, 2005 08:42 (UTC)lowlevel_print.cpp:37:23: warning: trigraph ??/ ignored, use -trigraphs to enable
no subject
Date: Oct. 16th, 2005 06:54 (UTC)Меня расстраивают камменты.
no subject
Date: Oct. 15th, 2005 07:18 (UTC)no subject
Date: Oct. 16th, 2005 06:54 (UTC)главное,
Date: Oct. 15th, 2005 09:50 (UTC)PS. такой код хорош для примера, а вот встертить в сырцах я бы не хотел.
Это
Date: Oct. 16th, 2005 06:53 (UTC)no subject
Date: Oct. 26th, 2005 16:41 (UTC)