| 1 |
// file : cutl/compiler/cxx-indenter.cxx |
| 2 |
// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC |
| 3 |
// license : MIT; see accompanying LICENSE file |
| 4 |
|
| 5 |
#include <cutl/compiler/cxx-indenter.hxx> |
| 6 |
|
| 7 |
namespace cutl |
| 8 |
{ |
| 9 |
namespace compiler |
| 10 |
{ |
| 11 |
template<> |
| 12 |
char const* cxx_indenter<char>:: |
| 13 |
keyword (cxx_indenter<char>::keyword_type t) |
| 14 |
{ |
| 15 |
static char const* keywords[] = |
| 16 |
{ |
| 17 |
"if", |
| 18 |
"do", |
| 19 |
"for", |
| 20 |
"else", |
| 21 |
"case", |
| 22 |
"while", |
| 23 |
"catch", |
| 24 |
"default" |
| 25 |
}; |
| 26 |
|
| 27 |
return keywords[t]; |
| 28 |
} |
| 29 |
|
| 30 |
template<> |
| 31 |
wchar_t const* cxx_indenter<wchar_t>:: |
| 32 |
keyword (cxx_indenter<wchar_t>::keyword_type t) |
| 33 |
{ |
| 34 |
static wchar_t const* keywords[] = |
| 35 |
{ |
| 36 |
L"if", |
| 37 |
L"do", |
| 38 |
L"for", |
| 39 |
L"else", |
| 40 |
L"case", |
| 41 |
L"while", |
| 42 |
L"catch", |
| 43 |
L"default" |
| 44 |
}; |
| 45 |
|
| 46 |
return keywords[t]; |
| 47 |
} |
| 48 |
} |
| 49 |
} |