Skip to content

Commit

Permalink
Fix eliben#33 pragma error when '=' occurs.
Browse files Browse the repository at this point in the history
'=' added to pppragma_ignore.
  • Loading branch information
wvi authored and w-vi committed Sep 9, 2014
1 parent 5153976 commit 044db0c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pycparser/c_lexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def t_pppragma_PPPRAGMA(self, t):
r'pragma'
pass

t_pppragma_ignore = ' \t<>.-{}();+-*/$%@&^~!?:,0123456789'
t_pppragma_ignore = ' \t<>.-{}();=+-*/$%@&^~!?:,0123456789'

@TOKEN(string_literal)
def t_pppragma_STR(self, t): pass
Expand Down
3 changes: 2 additions & 1 deletion tests/test_c_lexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ def test_preprocessor_pragma(self):
#pragma {pack: 2, smack: 3}
#pragma <includeme.h> "nowit.h"
#pragma "string"
#pragma somestring="some_other_string"
#pragma id 124124 and numbers 0235495
59
'''
Expand All @@ -325,7 +326,7 @@ def test_preprocessor_pragma(self):
self.assertEqual(t1.type, 'INT_CONST_DEC')
t2 = self.clex.token()
self.assertEqual(t2.type, 'INT_CONST_DEC')
self.assertEqual(t2.lineno, 10)
self.assertEqual(t2.lineno, 11)



Expand Down

0 comments on commit 044db0c

Please sign in to comment.