Merge pull request #3636 from opensourcerouting/defpy-text-tokens

python: make DEFPY provide the text token of fixed parameters
This commit is contained in:
Donald Sharp 2019-01-22 09:06:58 -05:00 committed by GitHub
commit eedb898796
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,7 +41,7 @@ class RenderHandler(object):
class StringHandler(RenderHandler):
argtype = 'const char *'
decl = Template('const char *$varname = NULL;')
code = Template('$varname = argv[_i]->arg;')
code = Template('$varname = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg;')
drop_str = True
canfail = False