~ubuntu-branches/ubuntu/intrepid/ecl/intrepid

« back to all changes in this revision

Viewing changes to src/c/read.d

  • Committer: Bazaar Package Importer
  • Author(s): Albin Tonnerre
  • Date: 2008-06-20 18:00:19 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080620180019-7fbz1ln5444vtkkr
Tags: 0.9j-20080306-2ubuntu1
* Enabled unicode support. (Closes: LP #123530)
* Modify Maintainer value to match the DebianMaintainerField specification.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- mode: c; c-basic-offset: 8 -*- */
1
2
/*
2
3
    read.d -- Read.
3
4
*/
135
136
}
136
137
 
137
138
static cl_object
138
 
ecl_read_object_with_delimiter(cl_object in, int delimiter, bool only_token)
 
139
ecl_read_object_with_delimiter(cl_object in, int delimiter, bool only_token, enum ecl_chattrib a)
139
140
{
140
141
        cl_object x, token;
141
142
        int c, base;
142
 
        enum ecl_chattrib a;
143
143
        cl_object p;
144
144
        cl_index length, i;
145
145
        int colon, intern_flag;
149
149
        cl_object escape_list; /* intervals of escaped characters */
150
150
        cl_fixnum upcase; /* # uppercase characters - # downcase characters */
151
151
        cl_fixnum count; /* number of unescaped characters */
152
 
 
 
152
        bool suppress = read_suppress;
 
153
        if (a != cat_constituent) {
 
154
                c = 0;
 
155
                goto LOOP;
 
156
        }
153
157
BEGIN:
154
158
        do {
155
159
                c = ecl_read_char(in);
167
171
                                         2, x, MAKE_FIXNUM(i));
168
172
                return o;
169
173
        }
 
174
LOOP:
170
175
        p = escape_list = Cnil;
171
176
        upcase = count = length = 0;
172
177
        external_symbol = colon = 0;
199
204
                        } else {
200
205
                                p = ecl_find_package_nolock(token);
201
206
                        }
202
 
                        if (Null(p)) {
 
207
                        if (Null(p) && !suppress) {
203
208
                                /* When loading binary files, we sometimes must create
204
209
                                   symbols whose package has not yet been maked. We
205
210
                                   allow it, but later on in read_VV we make sure that
287
292
                a = cat(rtbl, c);
288
293
        }
289
294
 
290
 
        if (read_suppress) {
 
295
        if (suppress) {
291
296
                x = Cnil;
292
297
                goto OUTPUT;
293
298
        }
356
361
cl_object
357
362
ecl_read_object(cl_object in)
358
363
{
359
 
        return ecl_read_object_with_delimiter(in, EOF, 0);
 
364
        return ecl_read_object_with_delimiter(in, EOF, 0, cat_constituent);
360
365
}
361
366
 
362
367
#define ecl_exponent_marker_p(i)        \
577
582
 
578
583
        if (backq_level <= 0)
579
584
                FEreader_error("A comma has appeared out of a backquote.", in, 0);
580
 
        /* Read character but skip spaces & complain at EOF */
581
 
        c = cl_peek_char(2,Ct,in);
 
585
        /* Read character & complain at EOF */
 
586
        c = cl_peek_char(2,Cnil,in);
582
587
        if (c == CODE_CHAR('@@')) {
583
588
                x = @'si::unquote-splice';
584
589
                ecl_read_char(in);
764
769
                        FEreader_error("~S is an illegal CHAR-FONT.", in, 1, d);
765
770
                        /*  assuming that CHAR-FONT-LIMIT is 1  */
766
771
        bds_bind(@'*readtable*', cl_core.standard_readtable);
767
 
        ecl_unread_char('\\', in);
768
 
        token = ecl_read_object_with_delimiter(in, EOF, 1);
 
772
        token = ecl_read_object_with_delimiter(in, EOF, 1, cat_single_escape);
769
773
        bds_unwind_n(1);
770
774
        if (token == Cnil) {
771
775
                c = Cnil;
896
900
                cl_index i;
897
901
                v = ecl_alloc_simple_vector(dim, aet_object);
898
902
                for (i = 0, last = Cnil;; i++) {
899
 
                        cl_object aux = ecl_read_object_with_delimiter(in, ')', 0);
 
903
                        cl_object aux = ecl_read_object_with_delimiter(in, ')', 0, cat_constituent);
900
904
                        if (aux == OBJNULL)
901
905
                                break;
902
906
                        if (i >= dim) {
1279
1283
                extra_argument('$', in, d);
1280
1284
        c = ecl_read_object(in);
1281
1285
        rs = cl_alloc_object(t_random);
1282
 
        rs->random.value = fixnnint(c);
 
1286
        rs->random.value = c;
1283
1287
        @(return rs)
1284
1288
}
1285
1289
 
1438
1442
        cl_object x, y = Cnil;
1439
1443
        cl_object *p = &y;
1440
1444
        do {
1441
 
                x = ecl_read_object_with_delimiter(in, d, 0);
 
1445
                x = ecl_read_object_with_delimiter(in, d, 0, cat_constituent);
1442
1446
                if (x == OBJNULL) {
1443
1447
                        /* End of the list. */
1444
1448
                        if (after_dot == 1) {
2119
2123
                (*entry_point)(MAKE_FIXNUM(0));
2120
2124
                x = cl_core.packages_to_be_created;
2121
2125
                loop_for_on(x) {
2122
 
                        if (!ecl_member(x, old_eptbc)) {
2123
 
                                CEerror("The following package was referenced in a~"
 
2126
                        if ((old_eptbc == OBJNULL) || !ecl_member(x, old_eptbc)) {
 
2127
                                CEerror(Ct, "The following package was referenced in a~"
2124
2128
                                "compiled file, but has not been created: ~A",
2125
2129
                                2, block->cblock.name, CAR(x));
2126
2130
                        }
2136
2140
        } CL_UNWIND_PROTECT_EXIT {
2137
2141
                if (in != OBJNULL)
2138
2142
                        cl_close(1,in);
 
2143
                cl_core.packages_to_be_created = old_eptbc;
2139
2144
        } CL_UNWIND_PROTECT_END;
2140
2145
 
2141
2146
        return block;