unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* hard coded tab length of 8 in update_port_lf() ?
@ 2014-12-16 15:03 Marco Heisig
  0 siblings, 0 replies; only message in thread
From: Marco Heisig @ 2014-12-16 15:03 UTC (permalink / raw)
  To: guile-user

Hi,

I use Guile to program a small compiler. I track the source location of
my individual tokens using port-line and port-column. However my column
numbers are slightly off depending on the number of tabs in that line.
It seems the Guile ports count each tab as up to 8 characters.

This is the relevant code in ports.h

#define SCM_TABCOL(port)      do {SCM_COL (port) += 8 - SCM_COL (port) %
8;} while (0)

I think it would be more intuitive to count one tab as one character
(afaik gcc does it this way). Is there a good reason for the current
behavior?

Sincerely,
Marco

PS: Writing a compiler in Guile is great fun! Thanks to all the Guile
developers for this awesome piece of software.




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-12-16 15:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-16 15:03 hard coded tab length of 8 in update_port_lf() ? Marco Heisig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).