From 5453d067d99b967075380c7a16c0db462831c9c6 Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 24 Mar 2002 20:11:46 +0000 Subject: [PATCH] lilypond-0.1.64 --- lib/include/source-file.hh | 2 +- lib/source-file.cc | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/include/source-file.hh b/lib/include/source-file.hh index ccf80eeded..0983a829a4 100644 --- a/lib/include/source-file.hh +++ b/lib/include/source-file.hh @@ -35,7 +35,7 @@ protected: Slice line_slice (char const* pos_ch_C) const; String line_str (char const* pos_ch_C) const; int column_i (char const* pos_ch_C) const; - int position_i (char const* pos_ch_C) const; + int char_i (char const* pos_ch_C) const; private: String name_str_; diff --git a/lib/source-file.cc b/lib/source-file.cc index 7a7470119d..14fabe7959 100644 --- a/lib/source-file.cc +++ b/lib/source-file.cc @@ -54,7 +54,7 @@ Source_file::file_line_column_str (char const *context_ch_C) const return _ ("(unknown)"); else return name_str () + ":" + String (line_i (context_ch_C)) - + ":" + String (position_i (context_ch_C)); + + ":" + String (char_i (context_ch_C)); } String @@ -112,7 +112,7 @@ Source_file::line_str (char const* pos_ch_C) const } int -Source_file::position_i (char const* pos_ch_C) const +Source_file::char_i (char const* pos_ch_C) const { if (!in_b (pos_ch_C)) return 0; @@ -127,11 +127,11 @@ Source_file::column_i (char const* pos_ch_C) const if (!in_b (pos_ch_C)) return 0; - int pos_i = position_i (pos_ch_C); + int ch_i = char_i (pos_ch_C); String line = line_str (pos_ch_C); int col_i = 0; - for (int i = 0; i < pos_i; i++) + for (int i = 0; i < ch_i; i++) if (line[i] == '\t') col_i = (col_i / 8 + 1) * 8; else @@ -146,12 +146,12 @@ Source_file::error_str (char const* pos_ch_C) const if (!in_b (pos_ch_C)) return _ ("(position unknown)"); - int pos_i = position_i (pos_ch_C); + int ch_i = char_i (pos_ch_C); String line = line_str (pos_ch_C); - String context = line.left_str (pos_i) + String context = line.left_str (ch_i) + String ('\n') + String (' ', column_i (pos_ch_C)) - + line.cut (pos_i, INT_MAX); + + line.cut (ch_i, INT_MAX); return context; } -- 2.39.5