Add . to bare-id to allow custom ops such as tf.add

PiperOrigin-RevId: 206840659
This commit is contained in:
Jacques Pienaar 2018-07-31 15:40:09 -07:00 committed by jpienaar
parent 6cfb09409f
commit 9ff86e6fc5
1 changed files with 3 additions and 3 deletions

View File

@ -155,13 +155,13 @@ Token Lexer::lexComment() {
/// Lex a bare identifier or keyword that starts with a letter.
///
/// bare-id ::= (letter|[_]) (letter|digit|[_$])*
/// bare-id ::= (letter|[_]) (letter|digit|[_$.])*
/// integer-type ::= `i[1-9][0-9]*`
///
Token Lexer::lexBareIdentifierOrKeyword(const char *tokStart) {
// Match the rest of the identifier regex: [0-9a-zA-Z_$]*
// Match the rest of the identifier regex: [0-9a-zA-Z_.$]*
while (isalpha(*curPtr) || isdigit(*curPtr) || *curPtr == '_' ||
*curPtr == '$')
*curPtr == '$' || *curPtr == '.')
++curPtr;
// Check to see if this identifier is a keyword.