~ubuntu-branches/ubuntu/quantal/texmacs/quantal

« back to all changes in this revision

Viewing changes to src/System/Language/math_language.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Atsuhito KOHDA, Kamaraju Kusumanchi, kohda
  • Date: 2009-04-26 19:35:14 UTC
  • mfrom: (1.1.10 upstream) (4.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090426193514-9yo3oggdslgdls4b
Tags: 1:1.0.7.2-1
[Kamaraju Kusumanchi <kamaraju@gmail.com>]
* New upstream release
* texmacs crashes if /usr/share/texmacs/TeXmacs/misc/pixmaps/unknown.ps
  is not present. Do not remove it. (Closes: #484073, #497021)
* update patches 03_mupad.dpatch, 04_axiom.dpatch, 11-desktop-file.dpatch
* fix the mime problem in gnome. Thanks to Andrea Gamba for the fix.
[kohda]
* Refined a fix for the mime problem in gnome a bit.
* Try to fix /bin/sh problem (debian/fixsh) but it is not complete fix yet.
* Try to fix hard coded settings for ipa fonts(patches/09_ipa.dpatch), 
  especially for Debian where no ipa fonts exist yet.
* Fixed obsolete Build-Depends: changed libltdl3-dev to 
  libltdl-dev | libltdl7-dev (the latter for Ubuntu?)

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
* DESCRIPTION: mathematical languages
5
5
* COPYRIGHT  : (C) 1999  Joris van der Hoeven
6
6
*******************************************************************************
7
 
* This software falls under the GNU general public license and comes WITHOUT
8
 
* ANY WARRANTY WHATSOEVER. See the file $TEXMACS_PATH/LICENSE for more details.
9
 
* If you don't have this file, write to the Free Software Foundation, Inc.,
10
 
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
7
* This software falls under the GNU general public license version 3 or later.
 
8
* It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
 
9
* in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
11
10
******************************************************************************/
12
11
 
13
12
#include "analyze.hpp"
94
93
    else {
95
94
      cerr << "Attempt to associate type " << r
96
95
           << " to " << class_name << "\n";
97
 
      fatal_error ("Unknown type", "math_language_rep::get_type");
 
96
      FAILED ("unknown type");
98
97
    }
99
98
  }
100
 
  else fatal_error ("Type declaration outside class definition",
101
 
                    "math_language_rep::get_type");
 
99
  else FAILED ("type declaration outside class definition");
102
100
}
103
101
 
104
102
void
105
103
math_language_rep::get_precedence (string s, int& i) {
106
104
  if (class_def) tpr_class(class_name).priority= as_int (get_string (s, i));
107
 
  else fatal_error ("Precedence declaration outside class definition",
108
 
                    "math_language_rep::get_precedence");
 
105
  else FAILED ("precedence declaration outside class definition");
109
106
}
110
107
 
111
108
void
116
113
    if (r == "Invalid") tpr_class(class_name).pen_before= HYPH_INVALID;
117
114
    else tpr_class(class_name).pen_before= as_int (r);
118
115
  }
119
 
  else fatal_error ("Left Penalty declaration outside class definition",
120
 
                    "math_language_rep::get_lpenalty");
 
116
  else FAILED ("left penalty declaration outside class definition");
121
117
}
122
118
 
123
119
void
128
124
    if (r == "Invalid") tpr_class(class_name).pen_after= HYPH_INVALID;
129
125
    else tpr_class(class_name).pen_after= as_int (r);
130
126
  }
131
 
  else fatal_error ("Right Penalty declaration outside class definition",
132
 
                    "math_language_rep::get_rpenalty");
 
127
  else FAILED ("right penalty declaration outside class definition");
133
128
}
134
129
 
135
130
void
153
148
        else {
154
149
          cerr << "Attempt to associate space " << l
155
150
               << " to " << class_name << "\n";
156
 
          fatal_error ("Unknown space", "math_language_rep::get_type");
 
151
          FAILED ("unknown space");
157
152
        }
158
153
        if (r == "None")
159
154
          tpr_class(class_name).spc_after= SPC_NONE;
164
159
        else {
165
160
          cerr << "Attempt to associate space " << r
166
161
               << " to " << class_name << "\n";
167
 
          fatal_error ("Unknown space", "math_language_rep::get_type");
 
162
          FAILED ("unknown space");
168
163
        }
169
164
        return;
170
165
      }
171
 
    fatal_error ("Missing comma in Spacing declaration",
172
 
                 "math_language_rep::get_spacing");
 
166
    FAILED ("missing comma in spacing declaration");
173
167
  }
174
 
  else fatal_error ("Spacing declaration outside class definition",
175
 
                    "math_language_rep::get_spacing");
 
168
  else FAILED ("spacing declaration outside class definition");
176
169
}
177
170
 
178
171
void
183
176
    else if (l == "Always") tpr_class(class_name).limits= LIMITS_ALWAYS;
184
177
    else tpr_class(class_name).limits= LIMITS_NONE;
185
178
  }
186
 
  else fatal_error ("Limits declaration outside class definition",
187
 
                    "math_language_rep::get_limits");
 
179
  else FAILED ("limits declaration outside class definition");
188
180
}
189
181
 
190
182
math_language_rep::math_language_rep (string name, string s):
228
220
        else {
229
221
          cerr << "Attempt to insert " << symbol
230
222
               << " to class " << class_name << "\n";
231
 
          if (class_def)
232
 
            fatal_error ("Member declaration inside class definition",
233
 
                         "math_language_rep::get_members");
234
 
          else
235
 
            fatal_error ("Unknown class",
236
 
                         "math_language_rep::get_members");
 
223
          if (!class_def) FAILED ("unknown class");
 
224
          FAILED ("member declaration inside class definition");
237
225
        }
238
226
      }
239
227
    }
299
287
 
300
288
array<int>
301
289
math_language_rep::get_hyphens (string s) {
302
 
  if (N(s)==0)
303
 
    fatal_error ("hyphenation of empty string",
304
 
                 "math_language_rep::get_hyphens");
305
 
 
 
290
  ASSERT (N(s) != 0, "hyphenation of empty string");
306
291
  int i, n= N(s)-1;
307
292
  bool flag= is_numeric (s);
308
293
  array<int> penalty (n);
350
335
  string s, fname= name * ".syx";
351
336
  if (DEBUG_VERBOSE) cout << "TeXmacs] Loading " << fname << "\n";
352
337
  load_string (url ("$TEXMACS_SYNTAX_PATH", fname), s, true);
353
 
  return new math_language_rep (name, s);
 
338
  return tm_new<math_language_rep> (name, s);
354
339
}
355
340
 
356
341
string