refactor read_directive
This commit is contained in:
parent
091dc9a668
commit
8d623da163
34
src/read.c
34
src/read.c
|
@ -118,34 +118,22 @@ read_datum_comment(pic_state *pic, struct pic_port *port, char c)
|
||||||
static pic_value
|
static pic_value
|
||||||
read_directive(pic_state *pic, struct pic_port *port, char c)
|
read_directive(pic_state *pic, struct pic_port *port, char c)
|
||||||
{
|
{
|
||||||
UNUSED(pic);
|
switch (peek(port)) {
|
||||||
|
case 'n':
|
||||||
c = next(port);
|
if (expect(port, "no-fold-case")) {
|
||||||
|
|
||||||
if (c == 'n') {
|
|
||||||
if(expect(port, "o-fold-case")){
|
|
||||||
/* :FIXME: set no-fold-case flag */
|
/* :FIXME: set no-fold-case flag */
|
||||||
|
return pic_undef_value();
|
||||||
}
|
}
|
||||||
else{
|
break;
|
||||||
xfseek(port->file, -1, SEEK_CUR);
|
case 'f':
|
||||||
goto shebang;
|
if (expect(port, "fold-case")) {
|
||||||
|
/* :FIXME: set fold-case flag */
|
||||||
|
return pic_undef_value();
|
||||||
}
|
}
|
||||||
}
|
break;
|
||||||
else if (c == 'f') {
|
|
||||||
if(expect(port, "old-case")){
|
|
||||||
/* :FIXME: set fold-case flag */
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
xfseek(port->file, -1, SEEK_CUR);
|
|
||||||
goto shebang;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
shebang:
|
|
||||||
while(xfgetc(port->file) != '\n');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return pic_undef_value();
|
return read_comment(pic, port, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
static pic_value
|
static pic_value
|
||||||
|
|
Loading…
Reference in New Issue