Skip to content

Commit 7772a64

Browse files
committed
Work around pygments lexer bug
This fix enables highlighting of the `flc_algorithm.i` file. Pygments only looks for `r'##*[a-zA-Z_]\w*'`, but it should also look for `r'##\s*\b'`. The pygments repo uses bitbucket and mercurial, and it has a huge backlog, so realistically I'm not going to bother submitting a patch upstream.
1 parent 61c441d commit 7772a64

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/flc_algorithm.i

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@
2121
// Operate using default "less than"
2222
template<class T>
2323
static RETURN_TYPE FUNCNAME(ARGS) {
24-
return FUNCNAME ## _impl(CALL, std::less<T>());
24+
return FUNCNAME##_impl(CALL, std::less<T>());
2525
}
2626
// Operate using user-provided function pointer
2727
template<class T>
28-
static RETURN_TYPE FUNCNAME ## _cmp(ARGS, bool (*cmp)(T, T)) {
29-
return FUNCNAME ## _impl(CALL, cmp);
28+
static RETURN_TYPE FUNCNAME##_cmp(ARGS, bool (*cmp)(T, T)) {
29+
return FUNCNAME##_impl(CALL, cmp);
3030
}
3131
}
3232

3333
%flc_template_numeric(FUNCNAME, FUNCNAME)
34-
%flc_template_numeric(FUNCNAME ## _cmp, FUNCNAME)
34+
%flc_template_numeric(FUNCNAME##_cmp, FUNCNAME)
3535

3636
%enddef
3737

@@ -41,7 +41,7 @@ static RETURN_TYPE FUNCNAME ## _cmp(ARGS, bool (*cmp)(T, T)) {
4141
// Define an abstract interface that gets inserted into the module
4242
%fragment("SWIG_cmp_funptr_"{CTYPE}, "fdecl", noblock=1)
4343
{ abstract interface
44-
function SWIG_cmp_funptr_ ## CTYPE(left, right) bind(C) &
44+
function SWIG_cmp_funptr_##CTYPE(left, right) bind(C) &
4545
result(fresult)
4646
use, intrinsic :: ISO_C_BINDING
4747
FTYPE, intent(in), value :: left, right
@@ -50,8 +50,8 @@ static RETURN_TYPE FUNCNAME ## _cmp(ARGS, bool (*cmp)(T, T)) {
5050
end interface}
5151

5252
%apply bool (*)(SWIGTYPE, SWIGTYPE) { bool (*)(CTYPE, CTYPE) };
53-
%typemap(ftype, in={procedure(SWIG_cmp_funptr_ ## CTYPE)}, fragment="SWIG_cmp_funptr_"{CTYPE}, noblock=1) bool (*)(CTYPE, CTYPE)
54-
{procedure(SWIG_cmp_funptr_ ## CTYPE), pointer}
53+
%typemap(ftype, in={procedure(SWIG_cmp_funptr_##CTYPE)}, fragment="SWIG_cmp_funptr_"{CTYPE}, noblock=1) bool (*)(CTYPE, CTYPE)
54+
{procedure(SWIG_cmp_funptr_##CTYPE), pointer}
5555

5656
%enddef
5757

0 commit comments

Comments
 (0)