cvs: php3 / language-scanner.lex

From: Date: Fri, 11 Aug 2000 21:38:35 +0000
Subject: cvs: php3 / language-scanner.lex
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-1152@lists.php.net to get a copy of this message
martin Fri Aug 11 14:38:35 2000 EDT Modified files: /php3 language-scanner.lex Log: Minor nit: When a character class contains the string [...+-/...] it is interpreted as the range from '+' thru '/' (which in ASCII contains the characters '+', ',', '-', '.', '/'). In the case of language-scanner.lex, that is apparently correct (the char classes I changed contained ',' and '.' anyway). But it looks to me like the range was not intended: the other punctuation characters in the class are not collapsed into ranges. Therefore I decided to put the '-' in front, so that it is not interpreted as a range, and remove it from [...+-/...] -> [-...+/...]. Though functionally this does not change anything, I think it makes the intention clearer. Index: php3/language-scanner.lex diff -u php3/language-scanner.lex:1.185 php3/language-scanner.lex:1.186 --- php3/language-scanner.lex:1.185 Mon Apr 10 12:29:36 2000 +++ php3/language-scanner.lex Fri Aug 11 14:38:34 2000 @@ -462,9 +462,9 @@ LABEL [a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]* WHITESPACE [ \n\r\t]+ TABS_AND_SPACES [ \t]* -TOKENS [;:,.\[\]()|^&+-/*=%!~$<>{}?@] +TOKENS [-;:,.\[\]()|^&+/*=%!~$<>{}?@] ENCAPSED_TOKENS [\[\]{}$] -ESCAPED_AND_WHITESPACE [\n\t\r #'.:;,()|^&+-/*=%!~<>?@]+ +ESCAPED_AND_WHITESPACE [-\n\t\r #'.:;,()|^&+/*=%!~<>?@]+ %option noyylineno %option noyywrap

« previous php.cvs (#1152) next »