[ 
https://issues.apache.org/jira/browse/THRIFT-1274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13089006#comment-13089006
 ] 

Dave Watson commented on THRIFT-1274:
-------------------------------------

Making * a known symbol should fix it: 

{code}diff --git a/compiler/cpp/src/thriftl.ll b/compiler/cpp/src/thriftl.ll
index c3d577e..af033d6 100644
--- a/compiler/cpp/src/thriftl.ll
+++ b/compiler/cpp/src/thriftl.ll
@@ -108,6 +108,7 @@ literal_begin (['\"])
 {unixcomment}        { /* do nothing */                 }
 
 {symbol}             { return yytext[0];                }
+"*"                  { return yytext[0];                }
 
 "namespace"          { return tok_namespace;            }
 "cpp_namespace"      { return tok_cpp_namespace;        }
{code}

>  thrift: fail compilation if an unexpected token is

> ----------------------------------------------------
>
>                 Key: THRIFT-1274
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1274
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>            Reporter: Dave Watson
>            Assignee: Dave Watson
>            Priority: Minor
>             Fix For: 0.8
>
>         Attachments: 
> 0006-thrift-fail-compilation-if-an-unexpected-token-is-en.patch.diff
>
>
> From e52b015b1c3d3b25ca1c905ea28cab80783a14bc Mon Sep 17 00:00:00 2001
> From: Adam Simpkins <simpk...@fb.com>
> Date: Fri, 26 Feb 2010 04:48:55 +0000
> Subject: [PATCH 06/33] thrift: fail compilation if an unexpected token is
>  encountered
> Summary:
> Currently, if the thrift lexer encounters a token it does not expect, it
> prints the token it to stdout and continues.  (This is the default
> behavior of flex when a token is unmatched.)  This updates thriftl.ll to
> fail with an error message when it sees an unexpected character.
> Test Plan:
> [internal fb thing].thrift contains a stray single-quote.
> Previously it was getting printed to stdout whenever you compile this
> file, or anything that includes it.  (Furthermore, it is printed out
> multiple times, since we scan the file twice each time it is included.
> Compiling [internal fb thing].thrift scans this file 8 times!)
> Now compiling this file fails with an error, as desired.  I'll submit a
> separate diff to fix [internal fb thing].thrift.
> ---
>  compiler/cpp/src/thriftl.ll |    9 +++++++++
>  1 files changed, 9 insertions(+), 0 deletions(-)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to