[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
prg2lout's erratic behaviour for character literals
From: |
Gabor Greif |
Subject: |
prg2lout's erratic behaviour for character literals |
Date: |
Tue, 26 Jun 2007 19:08:45 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.8.1.4) Gecko/20070531 SeaMonkey/1.1.2 |
Hi lout-users,
I observed strange things when formatting character constants
(literals) like 'F' in Haskell.
Looking into the prg2lout sources I see:
TOKEN CCharacterToken = {
U "character", /* used by error messages involving this token */
PRINT_WHOLE_QUOTED, /* print this token in quotes etc. as usual */
U "@PC", /* Lout command for formatting characters */
TOKEN EiffelCharacterToken = {
U "character", /* used by error messages involving this token */
PRINT_WHOLE_QUOTED, /* print this token in quotes etc. as usual */
U "@PC", /* Lout command for formatting characters */
TOKEN HaskellCharacterToken = {
U "character", /* used by error messages involving this token */
PRINT_WHOLE_QUOTED, /* print this token in quotes etc. as usual */
U "@PC", /* Lout command for formatting characters */
But @PC seems to invoke *comment* formatting:
/*****************************************************************************/
/* */
/* Tokens defining comments in various languages. */
/* */
/*****************************************************************************/
TOKEN CCommentToken = {
U "comment", /* used by error messages involving this token */
PRINT_WHOLE_QUOTED, /* print this token in quotes etc. as usual */
U "@PC", /* Lout command for formatting comments */
so I guess those 3 occurrences should be written as @PS to invoke string
formatting:
/* @PS for formatting strings */
/* @PC for formatting comments */
The second problem is unrelated, but provoked by the first one.
In my stderr I see many lines like this:
lout filter file "lout30" (from "Thrist.lout" line 662):
2,57: @Char dropped (character "minus}" unknown in font Symbol Base)
2,146: @Char dropped (character "minus}" unknown in font Symbol Base)
It appears that in haskellf this definition is wrong:
def @PC # for formatting comments
right x
{
@PCnoDelim { "{"@Symb address@hidden minus"}" }
}
--should possibly be->
def @PC # for formatting comments
right x
{
@PCnoDelim { "{"address@hidden address@hidden minus}"}" }
}
Jeff, could you integrate this into the next version?
Thanks,
Gabor
PS: I shall test these tentative patches as soon as I arrive at home.
PPS: I cited lout 3.33 sources, because this is the version I have here,
I have seen same thing with 3.34, did not try 3.35.
- prg2lout's erratic behaviour for character literals,
Gabor Greif <=