octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Small fix of column number in parser


From: Daniel Kraft
Subject: Small fix of column number in parser
Date: Tue, 05 Apr 2011 11:17:55 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.2.15) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9

Hi all,

attached is a hg changeset that fixes wrong column numbers. If the attached test.m is executed without the patch, one gets:

error: bar
error: called from:
error:   /tmp/test.m at line 2, column -1

With the patch, the column number is correctly reported as 1.

Note that this is somewhat the "minimal" version of the fix; since skip_white_space is only used once (in gobble_white_space) and also the stdio_stream_reader class is only used there, it may be nice to somewhat unify the code. Currently, line-numbers are tracked in stdio_stream_reader and column-numbers in skip_white_space.

Do you prefer this simple patch or should I work on some "clean-up" of this situation, too -- like making skip_white_space a member of stdio_stream_reader and unifying column- and line-number tracking in one place.

Yours,
Daniel

PS: Since this is my first attempt at both working with Mercurial and submitting a patch for octave, please let me know if there's something I should do different (and in general, comments welcome). In particular, is there some tag I should add to messages sent with patches? E.g., on the GCC lists, we have "[patch]" in the subjects of messages containing diff's.

--
http://www.pro-vegan.info/
--
Done:  Arc-Bar-Cav-Kni-Ran-Rog-Sam-Tou-Val-Wiz
To go: Hea-Mon-Pri

Attachment: test.m
Description: Text document

Attachment: column.diff
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]