Skip to content

Commit

Permalink
nim: update to Nim 1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnovak authored and Dav1dde committed Nov 6, 2019
1 parent 2a5ac49 commit 9c24809
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions glad/lang/nim/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ def _gl_types(gen, f):
'GLvdpauSurfaceNV': 'int32',
'GLvoid': 'pointer',
'GLsync': 'distinct pointer',
'GLeglClientBufferEXT': 'pointer', # GL_EXT_external_buffer
'GLVULKANPROCNV': 'pointer', # GL_NV_draw_vulkan_image
'ClContext': 'distinct pointer',
'ClEvent': 'distinct pointer'
},
Expand Down Expand Up @@ -482,15 +484,13 @@ def write_function_declaration(self, fobj, func):
# fobj.write(' {.cdecl.}]')
# fobj.write(' (getProcAddress("{}"))\n'.format(func.proto.name))


NIM_KEYWORDS = [ # as of Nim 0.13.0
'addr', 'and', 'as', 'asm', 'atomic',
NIM_KEYWORDS = [ # as of Nim 1.0.2
'addr', 'and', 'as', 'asm',
'bind', 'block', 'break',
'case', 'cast', 'concept', 'const', 'continue', 'converter',
'defer', 'discard', 'distinct', 'div', 'do',
'elif', 'else', 'end', 'enum', 'except', 'export',
'finally', 'for', 'from', 'func',
'generic',
'if', 'import', 'in', 'include', 'interface', 'is', 'isnot', 'iterator',
'let',
'macro', 'method', 'mixin', 'mod',
Expand All @@ -502,7 +502,7 @@ def write_function_declaration(self, fobj, func):
'template', 'try', 'tuple', 'type',
'using',
'var',
'when', 'while', 'with', 'without',
'when', 'while',
'xor',
'yield'
]
Expand All @@ -522,7 +522,10 @@ def write_boolean(self, fobj, name):
def write_enum(self, fobj, name, value, type='GLenum'):
fobj.write(' {}*'.format(self.map_enum_name(name)))
if type:
fobj.write(': {0} = {0}({1})'.format(type, value))
if type == 'uint64': # bit hacky...
fobj.write(": {0} = {1}'u64".format(type, value))
else:
fobj.write(': {0} = {0}({1})'.format(type, value))
else:
fobj.write(' = {}'.format(value))
fobj.write('\n')
Expand Down

0 comments on commit 9c24809

Please sign in to comment.