I’m using: SWI-Prolog version 8.0.3 on amd64 on linux mint.
I got fed up with Emacs today because it constantly breaks the syntax colouring when I use the single character form 0’_ … the single quote confuses it meaning that all the lines I have those on I usually have to add the comment: %’ …just to restore order.
token_type(0'(, bracket). %'
token_type(0'), bracket). %'
token_type(0'], bracket). %'
token_type(0'{, bracket). %'
token_type(0'}, bracket). %'
token_type(0';, com1). %'
token_type(_, tok). %'
to_bracket(0'(, o_paren). %'
to_bracket(0'), c_paren). %'
to_bracket(0'[, o_list). %'
to_bracket(0'], c_list). %'
to_bracket(0'{, o_map). %'
to_bracket(0'}, c_map). %'
to_bracket(X, huh) :- throw(tokfail(X)).
So…again, I thought I would go back to using the very capable built in emacs editor, but again I find it has issues, this time with indenting rather than the colouring. So which ever editor I use I am stuck with faulty colours or faulty indenting.
Here’s the indenting issue from PceEmacs,
tok_end(C) :-
( token_type(C, bracket)
; isws(C)
; C = 0';
).
Because the final check ends with the semicolon character, the indent engine seems not to want to put the closing paren out where I know it ought to be!!
How does everybody else manage? Is there another way of dealing with character constants that is more readable / less prone to bugging editors ? I know it’s a small thing but sometimes it really stops me getting into “the zone” with what I am doing… a simple tokeniser to learn some more.
Thanks chaps,
Sean.