summaryrefslogtreecommitdiff
path: root/lily/input.cc
diff options
context:
space:
mode:
authorPatrick McCarty <pnorcks@gmail.com>2009-11-10 21:22:25 -0800
committerPatrick McCarty <pnorcks@gmail.com>2009-11-12 16:37:48 -0800
commit2a5c70110bba2014507091c353c3e80d5dc5f796 (patch)
tree4d9ed88bc0f90d3f73b257375addbd251531c5b2 /lily/input.cc
parentf781f3307435c46ed3ff21708f75261dc30d2e37 (diff)
Remove mbrtowc(), and use utf8_char_len() instead.
- In get_counts(), revert the line_char variable to its original behavior: keeping track of the character count, not the byte offset. - Introduce a new parameter to get_counts() to keep track of the byte offset. - Use the byte offset data in Source_file::quote_input() to make sure the source line is split at the correct place.
Diffstat (limited to 'lily/input.cc')
-rw-r--r--lily/input.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/lily/input.cc b/lily/input.cc
index f2ddedd4e8..e302795042 100644
--- a/lily/input.cc
+++ b/lily/input.cc
@@ -147,8 +147,8 @@ Input::line_number () const
int
Input::column_number () const
{
- int line, chr, col = 0;
- source_file_->get_counts (start_, &line, &chr, &col);
+ int line, chr, col, offset = 0;
+ source_file_->get_counts (start_, &line, &chr, &col, &offset);
return col;
}
@@ -164,16 +164,16 @@ Input::end_line_number () const
int
Input::end_column_number () const
{
- int line, chr, col = 0;
- source_file_->get_counts (end_, &line, &chr, &col);
+ int line, chr, col, offset = 0;
+ source_file_->get_counts (end_, &line, &chr, &col, &offset);
return col;
}
void
-Input::get_counts (int *line, int *chr, int *col) const
+Input::get_counts (int *line, int *chr, int *col, int *offset) const
{
- source_file_->get_counts (start_, line, chr, col);
+ source_file_->get_counts (start_, line, chr, col, offset);
}
void