[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[misc 09/18] q2c: Prefer lex_match_id() over lex_match_hyphenated_word()
From: |
Ben Pfaff |
Subject: |
[misc 09/18] q2c: Prefer lex_match_id() over lex_match_hyphenated_word() in emitted code. |
Date: |
Sat, 11 Dec 2010 22:20:03 -0800 |
Until now, q2c has used lex_match_hyphenated_word() wherever it was
necessary to match a plain identifier. But it is better to use
lex_match_id() when it can be, because it is simpler and faster, so this
commit does that.
---
src/language/lexer/q2c.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/src/language/lexer/q2c.c b/src/language/lexer/q2c.c
index cf5a04e..73602bd 100644
--- a/src/language/lexer/q2c.c
+++ b/src/language/lexer/q2c.c
@@ -1422,12 +1422,14 @@ make_match (const char *t)
"|| lex_match_id (lexer, \"FALSE\"))");
else if (isdigit ((unsigned char) t[0]))
sprintf (s, "lex_match_int (lexer, %s)", t);
- else
+ else if (strchr (t, hyphen_proxy))
{
char *c = unmunge (t);
sprintf (s, "lex_match_hyphenated_word (lexer, \"%s\")", c);
free (c);
}
+ else
+ sprintf (s, "lex_match_id (lexer, \"%s\")", t);
return s;
}
--
1.7.1
- [misc 12/18] DO REPEAT: Make this command usable anywhere., (continued)
- [misc 12/18] DO REPEAT: Make this command usable anywhere., Ben Pfaff, 2010/12/12
- [misc 16/18] AGGREGATE: Align arg_func_tab[] in columns., Ben Pfaff, 2010/12/12
- [misc 10/18] NPAR TESTS: Prefer lex_match_id() over lex_match_hyphenated_word(), Ben Pfaff, 2010/12/12
- [misc 14/18] ECHO: Use text_item, as intended., Ben Pfaff, 2010/12/12
- [misc 04/18] covariance: Fix const-ness of covariance_calculate[_unnormalized] retval., Ben Pfaff, 2010/12/12
- [misc 08/18] DEBUG XFORM FAIL: Issue an error message as part of transformation., Ben Pfaff, 2010/12/12
- [misc 18/18] value-parser: Remove redundant call to lex_force_string() in parse_value()., Ben Pfaff, 2010/12/12
- [misc 17/18] GET DATA: Fix punctuation in error message., Ben Pfaff, 2010/12/12
- [misc 07/18] INPUT PROGRAM: Remove unused enumeration., Ben Pfaff, 2010/12/12
- [misc 03/18] ONEWAY: Fix warning for passing "const" pointer as non-const parameter., Ben Pfaff, 2010/12/12
- [misc 09/18] q2c: Prefer lex_match_id() over lex_match_hyphenated_word() in emitted code.,
Ben Pfaff <=
- [misc 02/18] mann-whitney: Suppress GCC warning about unused parameter., Ben Pfaff, 2010/12/12
- [misc 05/18] categoricals: Make parameter to categoricals_done() const., Ben Pfaff, 2010/12/12
- [misc 13/18] float-format: Don't translate test strings., Ben Pfaff, 2010/12/12
- [misc 11/18] identifier: New function token_type_to_string()., Ben Pfaff, 2010/12/12
- Re: [misc 00/18] miscellaneous minor improvements, John Darrington, 2010/12/12