Mercurial > ~dholland > hg > tradcpp > index.cgi
comparison place.c @ 160:d6e6b3940780
Fully implement #line.
author | Joerg Sonnenberger <joerg@bec.de> |
---|---|
date | Fri, 27 Feb 2015 02:06:49 +0100 |
parents | 95fbb216e23f |
children | a2f047301c15 |
comparison
equal
deleted
inserted
replaced
159:8cef6d7227a8 | 160:d6e6b3940780 |
---|---|
152 p->file = pf; | 152 p->file = pf; |
153 p->line = 1; | 153 p->line = 1; |
154 p->column = 1; | 154 p->column = 1; |
155 } | 155 } |
156 | 156 |
157 void | |
158 place_setfile(struct place *p, const char *name) | |
159 { | |
160 assert(p->type == P_FILE); | |
161 if (strcmp(name, p->file->name) == 0) { | |
162 return; | |
163 } | |
164 p->file = placefile_create(&p->file->includedfrom, name, | |
165 p->file->fromsystemdir); | |
166 } | |
167 | |
157 const char * | 168 const char * |
158 place_getname(const struct place *p) | 169 place_getname(const struct place *p) |
159 { | 170 { |
160 switch (p->type) { | 171 switch (p->type) { |
161 case P_NOWHERE: return "<nowhere>"; | 172 case P_NOWHERE: return "<nowhere>"; |