]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.1.64
authorfred <fred>
Sun, 24 Mar 2002 20:11:46 +0000 (20:11 +0000)
committerfred <fred>
Sun, 24 Mar 2002 20:11:46 +0000 (20:11 +0000)
lib/include/source-file.hh
lib/source-file.cc

index ccf80eededcf2c5907e639e033e427c52bebfa92..0983a829a4e0dc8012bae0da794b32e10b210d85 100644 (file)
@@ -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_;
index 7a7470119d8bc2371bc40aedd847b351793a960d..14fabe795911d66e2084c95dae716e7e64e3eed5 100644 (file)
@@ -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;
 }