mirror of
https://github.com/openappsec/openappsec.git
synced 2025-10-04 05:22:54 +03:00
Apr 27th Update
This commit is contained in:
22
external/graphqlparser/ast/cxx_impl.py
vendored
22
external/graphqlparser/ast/cxx_impl.py
vendored
@@ -10,7 +10,7 @@ class Printer(object):
|
||||
pass
|
||||
|
||||
def start_file(self):
|
||||
print C_LICENSE_COMMENT + '''/** @generated */
|
||||
print(C_LICENSE_COMMENT + '''/** @generated */
|
||||
|
||||
#include "Ast.h"
|
||||
#include "AstVisitor.h"
|
||||
@@ -18,17 +18,17 @@ class Printer(object):
|
||||
namespace facebook {
|
||||
namespace graphql {
|
||||
namespace ast {
|
||||
'''
|
||||
''')
|
||||
|
||||
def end_file(self):
|
||||
print '} // namespace ast'
|
||||
print '} // namespace graphql'
|
||||
print '} // namespace facebook'
|
||||
print('} // namespace ast')
|
||||
print('} // namespace graphql')
|
||||
print('} // namespace facebook')
|
||||
|
||||
def start_type(self, name):
|
||||
print '''void %s::accept(visitor::AstVisitor *visitor) const {
|
||||
print('''void %s::accept(visitor::AstVisitor *visitor) const {
|
||||
if (visitor->visit%s(*this)) {
|
||||
''' % (name, name)
|
||||
''' % (name, name))
|
||||
|
||||
def field(self, type, name, nullable, plural):
|
||||
if type in ['OperationKind', 'string', 'boolean']:
|
||||
@@ -38,18 +38,18 @@ namespace ast {
|
||||
accept = '{ for (const auto &x : *%s_) { x->accept(visitor); } }' % name
|
||||
if nullable:
|
||||
accept = 'if (%s_) %s' % (name, accept)
|
||||
print ' ' + accept
|
||||
print(' ' + accept)
|
||||
else:
|
||||
accept = '%s_->accept(visitor);' % name
|
||||
if nullable:
|
||||
accept = 'if (%s_) { %s }' % (name, accept)
|
||||
print ' ' + accept
|
||||
print(' ' + accept)
|
||||
|
||||
def end_type(self, name):
|
||||
print ''' }
|
||||
print(''' }
|
||||
visitor->endVisit%s(*this);
|
||||
}
|
||||
''' % name
|
||||
''' % name)
|
||||
|
||||
def start_union(self, name):
|
||||
pass
|
||||
|
Reference in New Issue
Block a user