X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Flexer%2Flexer.c;h=c08c428c4a4bf696bf2211318166b17e225bb77a;hb=740218f508466f16a79939cd97027b99f589d682;hp=b0b530bfe087747243c168b9fa2afb458c390f4d;hpb=691c25e36fd1ee722dd35419d6110e3876b99f9c;p=pspp-builds.git diff --git a/src/language/lexer/lexer.c b/src/language/lexer/lexer.c index b0b530bf..c08c428c 100644 --- a/src/language/lexer/lexer.c +++ b/src/language/lexer/lexer.c @@ -215,13 +215,8 @@ lex_get (struct lexer *lexer) { char *tail; - /* `-' can introduce a negative number, or it can be a - token by itself. If it is not followed by a digit or a - decimal point, it is definitely not a number. - Otherwise, it might be either, but most of the time we - want it as a number. When the syntax calls for a `-' - token, lex_negative_to_dash() must be used to break - negative numbers into two tokens. */ + /* `-' can introduce a negative number, or it can be a token by + itself. */ if (*lexer->prog == '-') { ds_put_byte (&lexer->tokstr, *lexer->prog++); @@ -1134,23 +1129,6 @@ lex_token_representation (struct lexer *lexer) /* Really weird functions. */ -/* Most of the time, a `-' is a lead-in to a negative number. But - sometimes it's actually part of the syntax. If a dash can be part - of syntax then this function is called to rip it off of a - number. */ -void -lex_negative_to_dash (struct lexer *lexer) -{ - if (lexer->token == T_NEG_NUM) - { - lexer->token = T_POS_NUM; - lexer->tokval = -lexer->tokval; - ds_assign_substring (&lexer->tokstr, ds_substr (&lexer->tokstr, 1, SIZE_MAX)); - save_token (lexer); - lexer->token = T_DASH; - } -} - /* Skip a COMMENT command. */ void lex_skip_comment (struct lexer *lexer)