diff options
author | Akim Demaille <akim.demaille@gmail.com> | 2019-09-16 08:19:35 +0200 |
---|---|---|
committer | Akim Demaille <akim.demaille@gmail.com> | 2019-09-22 09:12:08 +0200 |
commit | 945b917da252d3785bf1f32420461f178c31edbb (patch) | |
tree | f5fefa97ed997f399fb6d2e1605c1219f0e32fc5 /lib | |
parent | 1ef407d92320f96ea76504c70cdd1c310427d052 (diff) | |
download | bison-945b917da252d3785bf1f32420461f178c31edbb.tar.gz |
diagnostics: learn how to count column number with multibyte chars
So far diagnostics were cheating: in addition to the 'column' field of
locations (based on actual screen width per multibyte characters and
on tabulation expansion), the scanner sets the 'byte' field.
Diagnostics used this byte count to decide where to insert (color)
style.
We want to be able to truncate the quoted lines when there are too
wide to fit the screen. This requires that the diagnostics learn how
to count columns, the byte-in-boundary trick no longer works.
Bytes are still used for fix-its.
* bootstrap.conf: We need mbfile for mbf_getc.
* src/location.c (caret_info): We need an mbfile.
(caret_set_file): Initialize it.
(caret_getc): Convert to mbfile.
(location_caret): Instead of relying on the byte position to decide
where to insert the color style, count the current column using
boundary_compute.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/.gitignore | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/.gitignore b/lib/.gitignore index 237ae052..0f007442 100644 --- a/lib/.gitignore +++ b/lib/.gitignore @@ -133,6 +133,7 @@ /isnanf.c /isnanl-nolibm.h /isnanl.c +/iswblank.c /itold.c /ldexpl.c /libc-config.h @@ -149,6 +150,10 @@ /math.c /math.h /math.in.h +/mbchar.c +/mbchar.h +/mbfile.c +/mbfile.h /mbrtowc.c /mbsinit.c /mbswidth.c |