X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Flexer%2Flexer.c;h=149e35c715b99b826a09ffd947e9830d9f1ed170;hb=8021cf8974a46fe82af7b8952e448c0ea6858a48;hp=6396ecea5f4ea27414898f9320bcd734795129d6;hpb=fad7434e2db08ed248228e03533b314b8335ef2f;p=pspp-builds.git diff --git a/src/language/lexer/lexer.c b/src/language/lexer/lexer.c index 6396ecea..149e35c7 100644 --- a/src/language/lexer/lexer.c +++ b/src/language/lexer/lexer.c @@ -719,29 +719,33 @@ lex_put_back_id (struct lexer *lexer, const char *id) /* Returns the entire contents of the current line. */ const char * -lex_entire_line (struct lexer *lexer) +lex_entire_line (const struct lexer *lexer) { return ds_cstr (&lexer->line_buffer); } const struct string * -lex_entire_line_ds (struct lexer *lexer) +lex_entire_line_ds (const struct lexer *lexer) { return &lexer->line_buffer; } /* As lex_entire_line(), but only returns the part of the current line - that hasn't already been tokenized. - If END_DOT is non-null, stores nonzero into *END_DOT if the line - ends with a terminal dot, or zero if it doesn't. */ + that hasn't already been tokenized. */ const char * -lex_rest_of_line (struct lexer *lexer, int *end_dot) +lex_rest_of_line (const struct lexer *lexer) { - if (end_dot) - *end_dot = lexer->dot; return lexer->prog; } +/* Returns true if the current line ends in a terminal dot, + false otherwise. */ +bool +lex_end_dot (const struct lexer *lexer) +{ + return lexer->dot; +} + /* Causes the rest of the current input line to be ignored for tokenization purposes. */ void