refactor read_directive

This commit is contained in:
Yuichi Nishiwaki 2014-07-19 11:34:37 +09:00
parent 091dc9a668
commit 8d623da163
1 changed files with 11 additions and 23 deletions

View File

@ -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