Browse Source

Pascal style declaration grouping with ()

Ginger Bill 8 years ago
parent
commit
6b5e9aec8e
24 changed files with 2600 additions and 2475 deletions
  1. 20 12
      code/demo.odin
  2. 140 132
      core/_preload.odin
  3. 22 21
      core/bits.odin
  4. 8 7
      core/fmt.odin
  5. 42 42
      core/hash.odin
  6. 28 25
      core/math.odin
  7. 4 2
      core/mem.odin
  8. 4 2
      core/opengl.odin
  9. 1367 1367
      core/opengl_constants.odin
  10. 5 3
      core/os.odin
  11. 79 77
      core/os_linux.odin
  12. 49 47
      core/os_windows.odin
  13. 84 83
      core/os_x.odin
  14. 25 23
      core/raw.odin
  15. 4 2
      core/sync.odin
  16. 4 2
      core/sync_linux.odin
  17. 4 2
      core/sync_windows.odin
  18. 9 8
      core/utf16.odin
  19. 60 56
      core/utf8.odin
  20. 100 95
      src/check_stmt.cpp
  21. 150 133
      src/checker.cpp
  22. 72 62
      src/ir.cpp
  23. 319 216
      src/parser.cpp
  24. 1 56
      src/ssa.cpp

+ 20 - 12
code/demo.odin

@@ -1,15 +1,23 @@
-import "fmt.odin";
-import "atomics.odin";
-import "bits.odin";
-import "math.odin";
-import "mem.odin";
-import "opengl.odin";
-import "strconv.odin";
-import "strings.odin";
-import "sync.odin";
-import "types.odin";
-import "utf8.odin";
-import "utf16.odin";
+import (
+	"fmt.odin";
+	"hash.odin";
+	"atomics.odin";
+	"bits.odin";
+	"math.odin";
+	"mem.odin";
+	"opengl.odin";
+	"strconv.odin";
+	"strings.odin";
+	"sync.odin";
+	"types.odin";
+	"utf8.odin";
+	"utf16.odin";
+)
+
+const (
+	X = 123;
+	Y = 432;
+)
 
 proc main() {
 	proc(s: string){

+ 140 - 132
core/_preload.odin

@@ -1,10 +1,11 @@
 #shared_global_scope;
 
-import "os.odin";
-import "fmt.odin";
-import "utf8.odin";
-import "raw.odin";
-
+import (
+	"os.odin";
+	"fmt.odin";
+	"utf8.odin";
+	"raw.odin";
+)
 // Naming Conventions:
 // In general, PascalCase for types and snake_case for values
 //
@@ -24,95 +25,98 @@ import "raw.odin";
 
 // IMPORTANT NOTE(bill): Do not change the order of any of this data
 // The compiler relies upon this _exact_ order
-type TypeInfoEnumValue raw_union {
-	f: f64,
-	i: i128,
-}
-// NOTE(bill): This must match the compiler's
-type CallingConvention enum {
-	Odin = 0,
-	C    = 1,
-	Std  = 2,
-	Fast = 3,
-}
-
-type TypeInfoRecord struct #ordered {
-	types:        []^TypeInfo,
-	names:        []string,
-	offsets:      []int,  // offsets may not be used in tuples
-	usings:       []bool, // usings may not be used in tuples
-	packed:       bool,
-	ordered:      bool,
-	custom_align: bool,
-}
-
-type TypeInfo union {
-	size:  int,
-	align: int,
-
-	Named{name: string, base: ^TypeInfo},
-	Integer{signed: bool},
-	Rune{},
-	Float{},
-	Complex{},
-	String{},
-	Boolean{},
-	Any{},
-	Pointer{
-		elem: ^TypeInfo, // nil -> rawptr
-	},
-	Atomic{elem: ^TypeInfo},
-	Procedure{
-		params:     ^TypeInfo, // TypeInfo.Tuple
-		results:    ^TypeInfo, // TypeInfo.Tuple
-		variadic:   bool,
-		convention: CallingConvention,
-	},
-	Array{
-		elem:      ^TypeInfo,
-		elem_size: int,
-		count:     int,
-	},
-	DynamicArray{elem: ^TypeInfo, elem_size: int},
-	Slice       {elem: ^TypeInfo, elem_size: int},
-	Vector      {elem: ^TypeInfo, elem_size, count: int},
-	Tuple       {using record: TypeInfoRecord}, // Only really used for procedures
-	Struct      {using record: TypeInfoRecord},
-	RawUnion    {using record: TypeInfoRecord},
-	Union{
-		common_fields: struct {
-			types:     []^TypeInfo,
-			names:     []string,
-			offsets:   []int,    // offsets may not be used in tuples
+type (
+	TypeInfoEnumValue raw_union {
+		f: f64,
+		i: i128,
+	}
+	// NOTE(bill): This must match the compiler's
+	CallingConvention enum {
+		Odin = 0,
+		C    = 1,
+		Std  = 2,
+		Fast = 3,
+	}
+
+	TypeInfoRecord struct #ordered {
+		types:        []^TypeInfo,
+		names:        []string,
+		offsets:      []int,  // offsets may not be used in tuples
+		usings:       []bool, // usings may not be used in tuples
+		packed:       bool,
+		ordered:      bool,
+		custom_align: bool,
+	}
+
+	TypeInfo union {
+		size:  int,
+		align: int,
+
+		Named{name: string, base: ^TypeInfo},
+		Integer{signed: bool},
+		Rune{},
+		Float{},
+		Complex{},
+		String{},
+		Boolean{},
+		Any{},
+		Pointer{
+			elem: ^TypeInfo, // nil -> rawptr
 		},
-		variant_names: []string,
-		variant_types: []^TypeInfo,
-	},
-	Enum{
-		base:   ^TypeInfo,
-		names:  []string,
-		values: []TypeInfoEnumValue,
-	},
-	Map{
-		key:              ^TypeInfo,
-		value:            ^TypeInfo,
-		generated_struct: ^TypeInfo,
-		count:            int, // == 0 if dynamic
-	},
-	BitField{
-		names:   []string,
-		bits:    []i32,
-		offsets: []i32,
-	},
-}
-
+		Atomic{elem: ^TypeInfo},
+		Procedure{
+			params:     ^TypeInfo, // TypeInfo.Tuple
+			results:    ^TypeInfo, // TypeInfo.Tuple
+			variadic:   bool,
+			convention: CallingConvention,
+		},
+		Array{
+			elem:      ^TypeInfo,
+			elem_size: int,
+			count:     int,
+		},
+		DynamicArray{elem: ^TypeInfo, elem_size: int},
+		Slice       {elem: ^TypeInfo, elem_size: int},
+		Vector      {elem: ^TypeInfo, elem_size, count: int},
+		Tuple       {using record: TypeInfoRecord}, // Only really used for procedures
+		Struct      {using record: TypeInfoRecord},
+		RawUnion    {using record: TypeInfoRecord},
+		Union{
+			common_fields: struct {
+				types:     []^TypeInfo,
+				names:     []string,
+				offsets:   []int,    // offsets may not be used in tuples
+			},
+			variant_names: []string,
+			variant_types: []^TypeInfo,
+		},
+		Enum{
+			base:   ^TypeInfo,
+			names:  []string,
+			values: []TypeInfoEnumValue,
+		},
+		Map{
+			key:              ^TypeInfo,
+			value:            ^TypeInfo,
+			generated_struct: ^TypeInfo,
+			count:            int, // == 0 if dynamic
+		},
+		BitField{
+			names:   []string,
+			bits:    []i32,
+			offsets: []i32,
+		},
+	}
+)
 
 // NOTE(bill): only the ones that are needed (not all types)
 // This will be set by the compiler
-var __type_table: []TypeInfo;
+var (
+	__type_table: []TypeInfo;
 
-var __argv__: ^^u8;
-var __argc__: i32;
+	__argv__: ^^u8;
+	__argc__: i32;
+)
 
 proc type_info_base(info: ^TypeInfo) -> ^TypeInfo {
 	if info == nil {
@@ -151,29 +155,31 @@ proc read_cycle_counter() -> u64 #foreign __llvm_core "llvm.readcyclecounter";
 
 
 // IMPORTANT NOTE(bill): Must be in this order (as the compiler relies upon it)
-type AllocatorMode enum u8 {
-	Alloc,
-	Free,
-	FreeAll,
-	Resize,
-}
-type AllocatorProc proc(allocator_data: rawptr, mode: AllocatorMode,
-                        size, alignment: int,
-                        old_memory: rawptr, old_size: int, flags: u64) -> rawptr;
-type Allocator struct #ordered {
-	procedure: AllocatorProc,
-	data:      rawptr,
-}
+type (
+	AllocatorMode enum u8 {
+		Alloc,
+		Free,
+		FreeAll,
+		Resize,
+	}
+	AllocatorProc proc(allocator_data: rawptr, mode: AllocatorMode,
+	                        size, alignment: int,
+	                        old_memory: rawptr, old_size: int, flags: u64) -> rawptr;
+	Allocator struct #ordered {
+		procedure: AllocatorProc,
+		data:      rawptr,
+	}
 
 
-type Context struct #ordered {
-	thread_id: int,
+	Context struct #ordered {
+		thread_id: int,
 
-	allocator: Allocator,
+		allocator: Allocator,
 
-	user_data:  rawptr,
-	user_index: int,
-}
+		user_data:  rawptr,
+		user_index: int,
+	}
+)
 
 #thread_local var __context: Context;
 
@@ -553,33 +559,35 @@ proc __default_hash_string(s: string) -> u128 {
 
 const __INITIAL_MAP_CAP = 16;
 
-type __MapKey struct #ordered {
-	hash: u128,
-	str:  string,
-}
+type (
+	__MapKey struct #ordered {
+		hash: u128,
+		str:  string,
+	}
 
-type __MapFindResult struct #ordered {
-	hash_index:  int,
-	entry_prev:  int,
-	entry_index: int,
-}
+	__MapFindResult struct #ordered {
+		hash_index:  int,
+		entry_prev:  int,
+		entry_index: int,
+	}
 
-type __MapEntryHeader struct #ordered {
-	key:  __MapKey,
-	next: int,
-/*
-	value: Value_Type,
-*/
-}
+	__MapEntryHeader struct #ordered {
+		key:  __MapKey,
+		next: int,
+	/*
+		value: Value_Type,
+	*/
+	}
 
-type __MapHeader struct #ordered {
-	m:             ^raw.DynamicMap,
-	is_key_string: bool,
-	entry_size:    int,
-	entry_align:   int,
-	value_offset:  int,
-	value_size:    int,
-}
+	__MapHeader struct #ordered {
+		m:             ^raw.DynamicMap,
+		is_key_string: bool,
+		entry_size:    int,
+		entry_align:   int,
+		value_offset:  int,
+		value_size:    int,
+	}
+)
 
 proc __dynamic_map_reserve(using header: __MapHeader, cap: int)  {
 	__dynamic_array_reserve(&m.hashes, size_of(int), align_of(int), cap);

+ 22 - 21
core/bits.odin

@@ -1,27 +1,28 @@
-const U8_MIN   =   u8(0);
-const U16_MIN  =  u16(0);
-const U32_MIN  =  u32(0);
-const U64_MIN  =  u64(0);
-const U128_MIN = u128(0);
+const (
+	U8_MIN   =   u8(0);
+	U16_MIN  =  u16(0);
+	U32_MIN  =  u32(0);
+	U64_MIN  =  u64(0);
+	U128_MIN = u128(0);
 
-const I8_MIN   =   i8(-0x80);
-const I16_MIN  =  i16(-0x8000);
-const I32_MIN  =  i32(-0x8000_0000);
-const I64_MIN  =  i64(-0x8000_0000_0000_0000);
-const I128_MIN = i128(-0x8000_0000_0000_0000_0000_0000_0000_0000);
+	I8_MIN   =   i8(-0x80);
+	I16_MIN  =  i16(-0x8000);
+	I32_MIN  =  i32(-0x8000_0000);
+	I64_MIN  =  i64(-0x8000_0000_0000_0000);
+	I128_MIN = i128(-0x8000_0000_0000_0000_0000_0000_0000_0000);
 
-const U8_MAX   =   ~u8(0);
-const U16_MAX  =  ~u16(0);
-const U32_MAX  =  ~u32(0);
-const U64_MAX  =  ~u64(0);
-const U128_MAX = ~u128(0);
-
-const I8_MAX   =   i8(0x7f);
-const I16_MAX  =  i16(0x7fff);
-const I32_MAX  =  i32(0x7fff_ffff);
-const I64_MAX  =  i64(0x7fff_ffff_ffff_ffff);
-const I128_MAX = i128(0x7fff_ffff_ffff_ffff_ffff_ffff_ffff_ffff);
+	U8_MAX   =   ~u8(0);
+	U16_MAX  =  ~u16(0);
+	U32_MAX  =  ~u32(0);
+	U64_MAX  =  ~u64(0);
+	U128_MAX = ~u128(0);
 
+	I8_MAX   =   i8(0x7f);
+	I16_MAX  =  i16(0x7fff);
+	I32_MAX  =  i32(0x7fff_ffff);
+	I64_MAX  =  i64(0x7fff_ffff_ffff_ffff);
+	I128_MAX = i128(0x7fff_ffff_ffff_ffff_ffff_ffff_ffff_ffff);
+)
 
 proc count_ones(i:   u8) ->   u8 { proc __llvm_ctpop(u8)   ->   u8 #foreign __llvm_core "llvm.ctpop.i8";  return __llvm_ctpop(i); }
 proc count_ones(i:   i8) ->   i8 { proc __llvm_ctpop(i8)   ->   i8 #foreign __llvm_core "llvm.ctpop.i8";  return __llvm_ctpop(i); }

+ 8 - 7
core/fmt.odin

@@ -1,10 +1,11 @@
-import "os.odin";
-import "mem.odin";
-import "utf8.odin";
-import "types.odin";
-import "strconv.odin";
-import "raw.odin";
-
+import (
+	"os.odin";
+	"mem.odin";
+	"utf8.odin";
+	"types.odin";
+	"strconv.odin";
+	"raw.odin";
+)
 
 const _BUFFER_SIZE = 1<<12;
 

+ 42 - 42
core/hash.odin

@@ -1,61 +1,61 @@
-crc32 :: proc(data: []u8) -> u32 {
-	result := ~u32(0);
+proc crc32(data: []u8) -> u32 {
+	var result = ~u32(0);
 	for b in data {
 		result = result>>8 ~ _crc32_table[(result ~ u32(b)) & 0xff];
 	}
 	return ~result;
 }
-crc64 :: proc(data: []u8) -> u64 {
-	result := ~u64(0);
+proc crc64(data: []u8) -> u64 {
+	var result = ~u64(0);
 	for b in data {
 		result = result>>8 ~ _crc64_table[(result ~ u64(b)) & 0xff];
 	}
 	return ~result;
 }
 
-fnv32 :: proc(data: []u8) -> u32 {
-	h: u32 = 0x811c9dc5;
+proc fnv32(data: []u8) -> u32 {
+	var h: u32 = 0x811c9dc5;
 	for b in data {
 		h = (h * 0x01000193) ~ u32(b);
 	}
 	return h;
 }
 
-fnv64 :: proc(data: []u8) -> u64 {
-	h: u64 = 0xcbf29ce484222325;
+proc fnv64(data: []u8) -> u64 {
+	var h: u64 = 0xcbf29ce484222325;
 	for b in data {
 		h = (h * 0x100000001b3) ~ u64(b);
 	}
 	return h;
 }
 
-fnv32a :: proc(data: []u8) -> u32 {
-	h: u32 = 0x811c9dc5;
+proc fnv32a(data: []u8) -> u32 {
+	var h: u32 = 0x811c9dc5;
 	for b in data {
 		h = (h ~ u32(b)) * 0x01000193;
 	}
 	return h;
 }
 
-fnv64a :: proc(data: []u8) -> u64 {
-	h: u64 = 0xcbf29ce484222325;
+proc fnv64a(data: []u8) -> u64 {
+	var h: u64 = 0xcbf29ce484222325;
 	for b in data {
 		h = (h ~ u64(b)) * 0x100000001b3;
 	}
 	return h;
 }
 
-murmur32 :: proc(data: []u8) -> u32 {
-	c1_32: u32 : 0xcc9e2d51;
-	c2_32: u32 : 0x1b873593;
+proc murmur32(data: []u8) -> u32 {
+	const c1_32: u32 = 0xcc9e2d51;
+	const c2_32: u32 = 0x1b873593;
 
-	h1: u32 = 0;
-	nblocks := len(data)/4;
-	p := &data[0];
-	p1 := p + 4*nblocks;
+	var h1: u32 = 0;
+	var nblocks = len(data)/4;
+	var p = &data[0];
+	var p1 = p + 4*nblocks;
 
 	for ; p < p1; p += 4 {
-		k1 := ^u32(p)^;
+		var k1 = ^u32(p)^;
 
 		k1 *= c1_32;
 		k1 = (k1 << 15) | (k1 >> 17);
@@ -66,9 +66,9 @@ murmur32 :: proc(data: []u8) -> u32 {
 		h1 = h1*5 + 0xe6546b64;
 	}
 
-	tail := data[nblocks*4 ..];
+	var tail = data[nblocks*4 ..];
 
-	k1: u32;
+	var k1: u32;
 	match len(tail)&3 {
 	case 3:
 		k1 ~= u32(tail[2]) << 16;
@@ -95,18 +95,18 @@ murmur32 :: proc(data: []u8) -> u32 {
 	return h1;
 }
 
-murmur64 :: proc(data: []u8) -> u64 {
-	SEED :: 0x9747b28c;
+proc murmur64(data: []u8) -> u64 {
+	const SEED = 0x9747b28c;
 
 	when size_of(int) == 8 {
-		m :: 0xc6a4a7935bd1e995;
-		r :: 47;
+		const m = 0xc6a4a7935bd1e995;
+		const r = 47;
 
-		h: u64 = SEED ~ (u64(len(data)) * m);
-		data64 := slice_ptr(^u64(&data[0]), len(data)/size_of(u64));
+		var h: u64 = SEED ~ (u64(len(data)) * m);
+		var data64 = slice_ptr(^u64(&data[0]), len(data)/size_of(u64));
 
 		for _, i in data64 {
-			k := data64[i];
+			var k = data64[i];
 
 			k *= m;
 			k ~= k>>r;
@@ -134,18 +134,18 @@ murmur64 :: proc(data: []u8) -> u64 {
 
 		return h;
 	} else {
-		m :: 0x5bd1e995;
-		r :: 24;
+		const m = 0x5bd1e995;
+		const r = 24;
 
-		h1 := u32(SEED) ~ u32(len(data));
-		h2 := u32(SEED) >> 32;
+		var h1 = u32(SEED) ~ u32(len(data));
+		var h2 = u32(SEED) >> 32;
 
-		data32 := slice_ptr(cast(^u32)&data[0], len(data)/size_of(u32));
-		len := len(data);
+		var data32 = slice_ptr(cast(^u32)&data[0], len(data)/size_of(u32));
+		var len = len(data);
 
-		i := 0;
+		var i = 0;
 		for len >= 8 {
-			k1, k2: u32;
+			var k1, k2: u32;
 			k1 = data32[i]; i++;
 			k1 *= m;
 			k1 ~= k1>>r;
@@ -164,7 +164,7 @@ murmur64 :: proc(data: []u8) -> u64 {
 		}
 
 		if len >= 4 {
-			k1: u32;
+			var k1: u32;
 			k1 = data32[i]; i++;
 			k1 *= m;
 			k1 ~= k1>>r;
@@ -175,7 +175,7 @@ murmur64 :: proc(data: []u8) -> u64 {
 		}
 
 		// TODO(bill): Fix this
-		#no_bounds_check data8 := slice_to_bytes(data32[i..])[0..<3];
+		#no_bounds_check var data8 = slice_to_bytes(data32[i..])[0..<3];
 		match len {
 		case 3:
 			h2 ~= u32(data8[2]) << 16;
@@ -197,13 +197,13 @@ murmur64 :: proc(data: []u8) -> u64 {
 		h2 ~= h1>>19;
 		h2 *= m;
 
-		h := cast(u64)(h1)<<32 | cast(u64)(h2);
+		var h = cast(u64)(h1)<<32 | cast(u64)(h2);
 		return h;
 	}
 }
 
 
-immutable _crc32_table := [256]u32{
+let _crc32_table = [256]u32{
 	0x00000000, 0x77073096, 0xee0e612c, 0x990951ba,
 	0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,
 	0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
@@ -269,7 +269,7 @@ immutable _crc32_table := [256]u32{
 	0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94,
 	0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d,
 };
-immutable _crc64_table := [256]u64{
+let _crc64_table = [256]u64{
 	0x0000000000000000, 0x42f0e1eba9ea3693, 0x85e1c3d753d46d26, 0xc711223cfa3e5bb5,
 	0x493366450e42ecdf, 0x0bc387aea7a8da4c, 0xccd2a5925d9681f9, 0x8e224479f47cb76a,
 	0x9266cc8a1c85d9be, 0xd0962d61b56fef2d, 0x17870f5d4f51b498, 0x5577eeb6e6bb820b,

+ 28 - 25
core/math.odin

@@ -1,31 +1,34 @@
-const TAU          = 6.28318530717958647692528676655900576;
-const PI           = 3.14159265358979323846264338327950288;
-const ONE_OVER_TAU = 0.636619772367581343075535053490057448;
-const ONE_OVER_PI  = 0.159154943091895335768883763372514362;
-
-const E            = 2.71828182845904523536;
-const SQRT_TWO     = 1.41421356237309504880168872420969808;
-const SQRT_THREE   = 1.73205080756887729352744634150587236;
-const SQRT_FIVE    = 2.23606797749978969640917366873127623;
-
-const LOG_TWO      = 0.693147180559945309417232121458176568;
-const LOG_TEN      = 2.30258509299404568401799145468436421;
-
-const EPSILON      = 1.19209290e-7;
-
-const τ = TAU;
-const π = PI;
-
-type Vec2 [vector 2]f32;
-type Vec3 [vector 3]f32;
-type Vec4 [vector 4]f32;
+const (
+	TAU          = 6.28318530717958647692528676655900576;
+	PI           = 3.14159265358979323846264338327950288;
+	ONE_OVER_TAU = 0.636619772367581343075535053490057448;
+	ONE_OVER_PI  = 0.159154943091895335768883763372514362;
+
+	E            = 2.71828182845904523536;
+	SQRT_TWO     = 1.41421356237309504880168872420969808;
+	SQRT_THREE   = 1.73205080756887729352744634150587236;
+	SQRT_FIVE    = 2.23606797749978969640917366873127623;
+
+	LOG_TWO      = 0.693147180559945309417232121458176568;
+	LOG_TEN      = 2.30258509299404568401799145468436421;
+
+	EPSILON      = 1.19209290e-7;
+
+	τ = TAU;
+	π = PI;
+)
+type (
+	Vec2 [vector 2]f32;
+	Vec3 [vector 3]f32;
+	Vec4 [vector 4]f32;
 
 // Column major
-type Mat2 [2][2]f32;
-type Mat3 [3][3]f32;
-type Mat4 [4][4]f32;
+	Mat2 [2][2]f32;
+	Mat3 [3][3]f32;
+	Mat4 [4][4]f32;
 
-type Complex complex64;
+	Complex complex64;
+)
 
 proc sqrt(x: f32) -> f32 #foreign __llvm_core "llvm.sqrt.f32";
 proc sqrt(x: f64) -> f64 #foreign __llvm_core "llvm.sqrt.f64";

+ 4 - 2
core/mem.odin

@@ -1,5 +1,7 @@
-import "fmt.odin";
-import "os.odin";
+import (
+	"fmt.odin";
+	"os.odin";
+)
 
 proc swap(b: u16) -> u16 #foreign __llvm_core "llvm.bswap.i16";
 proc swap(b: u32) -> u32 #foreign __llvm_core "llvm.bswap.i32";

+ 4 - 2
core/opengl.odin

@@ -1,7 +1,9 @@
 #foreign_system_library lib "opengl32.lib" when ODIN_OS == "windows";
 #foreign_system_library lib "gl" when ODIN_OS == "linux";
-import win32 "sys/windows.odin" when ODIN_OS == "windows";
-import "sys/wgl.odin" when ODIN_OS == "windows";
+import (
+	win32 "sys/windows.odin" when ODIN_OS == "windows";
+	"sys/wgl.odin" when ODIN_OS == "windows";
+)
 import_load "opengl_constants.odin";
 
 proc Clear         (mask: u32)                                #foreign lib "glClear";

+ 1367 - 1367
core/opengl_constants.odin

@@ -1,1385 +1,1385 @@
+const (
+	FALSE                          = 0;
+	TRUE                           = 1;
 
-const FALSE                          = 0;
-const TRUE                           = 1;
+	DEPTH_BUFFER_BIT               = 0x00000100;
+	STENCIL_BUFFER_BIT             = 0x00000400;
+	COLOR_BUFFER_BIT               = 0x00004000;
+	POINTS                         = 0x0000;
+	LINES                          = 0x0001;
+	LINE_LOOP                      = 0x0002;
+	LINE_STRIP                     = 0x0003;
+	TRIANGLES                      = 0x0004;
+	TRIANGLE_STRIP                 = 0x0005;
+	TRIANGLE_FAN                   = 0x0006;
+	QUADS                          = 0x0007;
+	NEVER                          = 0x0200;
+	LESS                           = 0x0201;
+	EQUAL                          = 0x0202;
+	LEQUAL                         = 0x0203;
+	GREATER                        = 0x0204;
+	NOTEQUAL                       = 0x0205;
+	GEQUAL                         = 0x0206;
+	ALWAYS                         = 0x0207;
+	ZERO                           = 0;
+	ONE                            = 1;
+	SRC_COLOR                      = 0x0300;
+	ONE_MINUS_SRC_COLOR            = 0x0301;
+	SRC_ALPHA                      = 0x0302;
+	ONE_MINUS_SRC_ALPHA            = 0x0303;
+	DST_ALPHA                      = 0x0304;
+	ONE_MINUS_DST_ALPHA            = 0x0305;
+	DST_COLOR                      = 0x0306;
+	ONE_MINUS_DST_COLOR            = 0x0307;
+	SRC_ALPHA_SATURATE             = 0x0308;
+	NONE                           = 0;
+	FRONT_LEFT                     = 0x0400;
+	FRONT_RIGHT                    = 0x0401;
+	BACK_LEFT                      = 0x0402;
+	BACK_RIGHT                     = 0x0403;
+	FRONT                          = 0x0404;
+	BACK                           = 0x0405;
+	LEFT                           = 0x0406;
+	RIGHT                          = 0x0407;
+	FRONT_AND_BACK                 = 0x0408;
+	NO_ERROR                       = 0;
+	INVALID_ENUM                   = 0x0500;
+	INVALID_VALUE                  = 0x0501;
+	INVALID_OPERATION              = 0x0502;
+	OUT_OF_MEMORY                  = 0x0505;
+	CW                             = 0x0900;
+	CCW                            = 0x0901;
+	POINT_SIZE                     = 0x0B11;
+	POINT_SIZE_RANGE               = 0x0B12;
+	POINT_SIZE_GRANULARITY         = 0x0B13;
+	LINE_SMOOTH                    = 0x0B20;
+	LINE_WIDTH                     = 0x0B21;
+	LINE_WIDTH_RANGE               = 0x0B22;
+	LINE_WIDTH_GRANULARITY         = 0x0B23;
+	POLYGON_MODE                   = 0x0B40;
+	POLYGON_SMOOTH                 = 0x0B41;
+	CULL_FACE                      = 0x0B44;
+	CULL_FACE_MODE                 = 0x0B45;
+	FRONT_FACE                     = 0x0B46;
+	DEPTH_RANGE                    = 0x0B70;
+	DEPTH_TEST                     = 0x0B71;
+	DEPTH_WRITEMASK                = 0x0B72;
+	DEPTH_CLEAR_VALUE              = 0x0B73;
+	DEPTH_FUNC                     = 0x0B74;
+	STENCIL_TEST                   = 0x0B90;
+	STENCIL_CLEAR_VALUE            = 0x0B91;
+	STENCIL_FUNC                   = 0x0B92;
+	STENCIL_VALUE_MASK             = 0x0B93;
+	STENCIL_FAIL                   = 0x0B94;
+	STENCIL_PASS_DEPTH_FAIL        = 0x0B95;
+	STENCIL_PASS_DEPTH_PASS        = 0x0B96;
+	STENCIL_REF                    = 0x0B97;
+	STENCIL_WRITEMASK              = 0x0B98;
+	VIEWPORT                       = 0x0BA2;
+	DITHER                         = 0x0BD0;
+	BLEND_DST                      = 0x0BE0;
+	BLEND_SRC                      = 0x0BE1;
+	BLEND                          = 0x0BE2;
+	LOGIC_OP_MODE                  = 0x0BF0;
+	COLOR_LOGIC_OP                 = 0x0BF2;
+	DRAW_BUFFER                    = 0x0C01;
+	READ_BUFFER                    = 0x0C02;
+	SCISSOR_BOX                    = 0x0C10;
+	SCISSOR_TEST                   = 0x0C11;
+	COLOR_CLEAR_VALUE              = 0x0C22;
+	COLOR_WRITEMASK                = 0x0C23;
+	DOUBLEBUFFER                   = 0x0C32;
+	STEREO                         = 0x0C33;
+	LINE_SMOOTH_HINT               = 0x0C52;
+	POLYGON_SMOOTH_HINT            = 0x0C53;
+	UNPACK_SWAP_BYTES              = 0x0CF0;
+	UNPACK_LSB_FIRST               = 0x0CF1;
+	UNPACK_ROW_LENGTH              = 0x0CF2;
+	UNPACK_SKIP_ROWS               = 0x0CF3;
+	UNPACK_SKIP_PIXELS             = 0x0CF4;
+	UNPACK_ALIGNMENT               = 0x0CF5;
+	PACK_SWAP_BYTES                = 0x0D00;
+	PACK_LSB_FIRST                 = 0x0D01;
+	PACK_ROW_LENGTH                = 0x0D02;
+	PACK_SKIP_ROWS                 = 0x0D03;
+	PACK_SKIP_PIXELS               = 0x0D04;
+	PACK_ALIGNMENT                 = 0x0D05;
+	MAX_TEXTURE_SIZE               = 0x0D33;
+	MAX_VIEWPORT_DIMS              = 0x0D3A;
+	SUBPIXEL_BITS                  = 0x0D50;
+	TEXTURE_1D                     = 0x0DE0;
+	TEXTURE_2D                     = 0x0DE1;
+	POLYGON_OFFSET_UNITS           = 0x2A00;
+	POLYGON_OFFSET_POINT           = 0x2A01;
+	POLYGON_OFFSET_LINE            = 0x2A02;
+	POLYGON_OFFSET_FILL            = 0x8037;
+	POLYGON_OFFSET_FACTOR          = 0x8038;
+	TEXTURE_BINDING_1D             = 0x8068;
+	TEXTURE_BINDING_2D             = 0x8069;
+	TEXTURE_WIDTH                  = 0x1000;
+	TEXTURE_HEIGHT                 = 0x1001;
+	TEXTURE_INTERNAL_FORMAT        = 0x1003;
+	TEXTURE_BORDER_COLOR           = 0x1004;
+	TEXTURE_RED_SIZE               = 0x805C;
+	TEXTURE_GREEN_SIZE             = 0x805D;
+	TEXTURE_BLUE_SIZE              = 0x805E;
+	TEXTURE_ALPHA_SIZE             = 0x805F;
+	DONT_CARE                      = 0x1100;
+	FASTEST                        = 0x1101;
+	NICEST                         = 0x1102;
+	BYTE                           = 0x1400;
+	UNSIGNED_BYTE                  = 0x1401;
+	SHORT                          = 0x1402;
+	UNSIGNED_SHORT                 = 0x1403;
+	INT                            = 0x1404;
+	UNSIGNED_INT                   = 0x1405;
+	FLOAT                          = 0x1406;
+	DOUBLE                         = 0x140A;
+	STACK_OVERFLOW                 = 0x0503;
+	STACK_UNDERFLOW                = 0x0504;
+	CLEAR                          = 0x1500;
+	AND                            = 0x1501;
+	AND_REVERSE                    = 0x1502;
+	COPY                           = 0x1503;
+	AND_INVERTED                   = 0x1504;
+	NOOP                           = 0x1505;
+	XOR                            = 0x1506;
+	OR                             = 0x1507;
+	NOR                            = 0x1508;
+	EQUIV                          = 0x1509;
+	INVERT                         = 0x150A;
+	OR_REVERSE                     = 0x150B;
+	COPY_INVERTED                  = 0x150C;
+	OR_INVERTED                    = 0x150D;
+	NAND                           = 0x150E;
+	SET                            = 0x150F;
+	TEXTURE                        = 0x1702;
+	COLOR                          = 0x1800;
+	DEPTH                          = 0x1801;
+	STENCIL                        = 0x1802;
+	STENCIL_INDEX                  = 0x1901;
+	DEPTH_COMPONENT                = 0x1902;
+	RED                            = 0x1903;
+	GREEN                          = 0x1904;
+	BLUE                           = 0x1905;
+	ALPHA                          = 0x1906;
+	RGB                            = 0x1907;
+	RGBA                           = 0x1908;
+	POINT                          = 0x1B00;
+	LINE                           = 0x1B01;
+	FILL                           = 0x1B02;
+	KEEP                           = 0x1E00;
+	REPLACE                        = 0x1E01;
+	INCR                           = 0x1E02;
+	DECR                           = 0x1E03;
+	VENDOR                         = 0x1F00;
+	RENDERER                       = 0x1F01;
+	VERSION                        = 0x1F02;
+	EXTENSIONS                     = 0x1F03;
+	NEAREST                        = 0x2600;
+	LINEAR                         = 0x2601;
+	NEAREST_MIPMAP_NEAREST         = 0x2700;
+	LINEAR_MIPMAP_NEAREST          = 0x2701;
+	NEAREST_MIPMAP_LINEAR          = 0x2702;
+	LINEAR_MIPMAP_LINEAR           = 0x2703;
+	TEXTURE_MAG_FILTER             = 0x2800;
+	TEXTURE_MIN_FILTER             = 0x2801;
+	TEXTURE_WRAP_S                 = 0x2802;
+	TEXTURE_WRAP_T                 = 0x2803;
+	PROXY_TEXTURE_1D               = 0x8063;
+	PROXY_TEXTURE_2D               = 0x8064;
+	REPEAT                         = 0x2901;
+	R3_G3_B2                       = 0x2A10;
+	RGB4                           = 0x804F;
+	RGB5                           = 0x8050;
+	RGB8                           = 0x8051;
+	RGB10                          = 0x8052;
+	RGB12                          = 0x8053;
+	RGB16                          = 0x8054;
+	RGBA2                          = 0x8055;
+	RGBA4                          = 0x8056;
+	RGB5_A1                        = 0x8057;
+	RGBA8                          = 0x8058;
+	RGB10_A2                       = 0x8059;
+	RGBA12                         = 0x805A;
+	RGBA16                         = 0x805B;
+	VERTEX_ARRAY                   = 0x8074;
 
-const DEPTH_BUFFER_BIT               = 0x00000100;
-const STENCIL_BUFFER_BIT             = 0x00000400;
-const COLOR_BUFFER_BIT               = 0x00004000;
-const POINTS                         = 0x0000;
-const LINES                          = 0x0001;
-const LINE_LOOP                      = 0x0002;
-const LINE_STRIP                     = 0x0003;
-const TRIANGLES                      = 0x0004;
-const TRIANGLE_STRIP                 = 0x0005;
-const TRIANGLE_FAN                   = 0x0006;
-const QUADS                          = 0x0007;
-const NEVER                          = 0x0200;
-const LESS                           = 0x0201;
-const EQUAL                          = 0x0202;
-const LEQUAL                         = 0x0203;
-const GREATER                        = 0x0204;
-const NOTEQUAL                       = 0x0205;
-const GEQUAL                         = 0x0206;
-const ALWAYS                         = 0x0207;
-const ZERO                           = 0;
-const ONE                            = 1;
-const SRC_COLOR                      = 0x0300;
-const ONE_MINUS_SRC_COLOR            = 0x0301;
-const SRC_ALPHA                      = 0x0302;
-const ONE_MINUS_SRC_ALPHA            = 0x0303;
-const DST_ALPHA                      = 0x0304;
-const ONE_MINUS_DST_ALPHA            = 0x0305;
-const DST_COLOR                      = 0x0306;
-const ONE_MINUS_DST_COLOR            = 0x0307;
-const SRC_ALPHA_SATURATE             = 0x0308;
-const NONE                           = 0;
-const FRONT_LEFT                     = 0x0400;
-const FRONT_RIGHT                    = 0x0401;
-const BACK_LEFT                      = 0x0402;
-const BACK_RIGHT                     = 0x0403;
-const FRONT                          = 0x0404;
-const BACK                           = 0x0405;
-const LEFT                           = 0x0406;
-const RIGHT                          = 0x0407;
-const FRONT_AND_BACK                 = 0x0408;
-const NO_ERROR                       = 0;
-const INVALID_ENUM                   = 0x0500;
-const INVALID_VALUE                  = 0x0501;
-const INVALID_OPERATION              = 0x0502;
-const OUT_OF_MEMORY                  = 0x0505;
-const CW                             = 0x0900;
-const CCW                            = 0x0901;
-const POINT_SIZE                     = 0x0B11;
-const POINT_SIZE_RANGE               = 0x0B12;
-const POINT_SIZE_GRANULARITY         = 0x0B13;
-const LINE_SMOOTH                    = 0x0B20;
-const LINE_WIDTH                     = 0x0B21;
-const LINE_WIDTH_RANGE               = 0x0B22;
-const LINE_WIDTH_GRANULARITY         = 0x0B23;
-const POLYGON_MODE                   = 0x0B40;
-const POLYGON_SMOOTH                 = 0x0B41;
-const CULL_FACE                      = 0x0B44;
-const CULL_FACE_MODE                 = 0x0B45;
-const FRONT_FACE                     = 0x0B46;
-const DEPTH_RANGE                    = 0x0B70;
-const DEPTH_TEST                     = 0x0B71;
-const DEPTH_WRITEMASK                = 0x0B72;
-const DEPTH_CLEAR_VALUE              = 0x0B73;
-const DEPTH_FUNC                     = 0x0B74;
-const STENCIL_TEST                   = 0x0B90;
-const STENCIL_CLEAR_VALUE            = 0x0B91;
-const STENCIL_FUNC                   = 0x0B92;
-const STENCIL_VALUE_MASK             = 0x0B93;
-const STENCIL_FAIL                   = 0x0B94;
-const STENCIL_PASS_DEPTH_FAIL        = 0x0B95;
-const STENCIL_PASS_DEPTH_PASS        = 0x0B96;
-const STENCIL_REF                    = 0x0B97;
-const STENCIL_WRITEMASK              = 0x0B98;
-const VIEWPORT                       = 0x0BA2;
-const DITHER                         = 0x0BD0;
-const BLEND_DST                      = 0x0BE0;
-const BLEND_SRC                      = 0x0BE1;
-const BLEND                          = 0x0BE2;
-const LOGIC_OP_MODE                  = 0x0BF0;
-const COLOR_LOGIC_OP                 = 0x0BF2;
-const DRAW_BUFFER                    = 0x0C01;
-const READ_BUFFER                    = 0x0C02;
-const SCISSOR_BOX                    = 0x0C10;
-const SCISSOR_TEST                   = 0x0C11;
-const COLOR_CLEAR_VALUE              = 0x0C22;
-const COLOR_WRITEMASK                = 0x0C23;
-const DOUBLEBUFFER                   = 0x0C32;
-const STEREO                         = 0x0C33;
-const LINE_SMOOTH_HINT               = 0x0C52;
-const POLYGON_SMOOTH_HINT            = 0x0C53;
-const UNPACK_SWAP_BYTES              = 0x0CF0;
-const UNPACK_LSB_FIRST               = 0x0CF1;
-const UNPACK_ROW_LENGTH              = 0x0CF2;
-const UNPACK_SKIP_ROWS               = 0x0CF3;
-const UNPACK_SKIP_PIXELS             = 0x0CF4;
-const UNPACK_ALIGNMENT               = 0x0CF5;
-const PACK_SWAP_BYTES                = 0x0D00;
-const PACK_LSB_FIRST                 = 0x0D01;
-const PACK_ROW_LENGTH                = 0x0D02;
-const PACK_SKIP_ROWS                 = 0x0D03;
-const PACK_SKIP_PIXELS               = 0x0D04;
-const PACK_ALIGNMENT                 = 0x0D05;
-const MAX_TEXTURE_SIZE               = 0x0D33;
-const MAX_VIEWPORT_DIMS              = 0x0D3A;
-const SUBPIXEL_BITS                  = 0x0D50;
-const TEXTURE_1D                     = 0x0DE0;
-const TEXTURE_2D                     = 0x0DE1;
-const POLYGON_OFFSET_UNITS           = 0x2A00;
-const POLYGON_OFFSET_POINT           = 0x2A01;
-const POLYGON_OFFSET_LINE            = 0x2A02;
-const POLYGON_OFFSET_FILL            = 0x8037;
-const POLYGON_OFFSET_FACTOR          = 0x8038;
-const TEXTURE_BINDING_1D             = 0x8068;
-const TEXTURE_BINDING_2D             = 0x8069;
-const TEXTURE_WIDTH                  = 0x1000;
-const TEXTURE_HEIGHT                 = 0x1001;
-const TEXTURE_INTERNAL_FORMAT        = 0x1003;
-const TEXTURE_BORDER_COLOR           = 0x1004;
-const TEXTURE_RED_SIZE               = 0x805C;
-const TEXTURE_GREEN_SIZE             = 0x805D;
-const TEXTURE_BLUE_SIZE              = 0x805E;
-const TEXTURE_ALPHA_SIZE             = 0x805F;
-const DONT_CARE                      = 0x1100;
-const FASTEST                        = 0x1101;
-const NICEST                         = 0x1102;
-const BYTE                           = 0x1400;
-const UNSIGNED_BYTE                  = 0x1401;
-const SHORT                          = 0x1402;
-const UNSIGNED_SHORT                 = 0x1403;
-const INT                            = 0x1404;
-const UNSIGNED_INT                   = 0x1405;
-const FLOAT                          = 0x1406;
-const DOUBLE                         = 0x140A;
-const STACK_OVERFLOW                 = 0x0503;
-const STACK_UNDERFLOW                = 0x0504;
-const CLEAR                          = 0x1500;
-const AND                            = 0x1501;
-const AND_REVERSE                    = 0x1502;
-const COPY                           = 0x1503;
-const AND_INVERTED                   = 0x1504;
-const NOOP                           = 0x1505;
-const XOR                            = 0x1506;
-const OR                             = 0x1507;
-const NOR                            = 0x1508;
-const EQUIV                          = 0x1509;
-const INVERT                         = 0x150A;
-const OR_REVERSE                     = 0x150B;
-const COPY_INVERTED                  = 0x150C;
-const OR_INVERTED                    = 0x150D;
-const NAND                           = 0x150E;
-const SET                            = 0x150F;
-const TEXTURE                        = 0x1702;
-const COLOR                          = 0x1800;
-const DEPTH                          = 0x1801;
-const STENCIL                        = 0x1802;
-const STENCIL_INDEX                  = 0x1901;
-const DEPTH_COMPONENT                = 0x1902;
-const RED                            = 0x1903;
-const GREEN                          = 0x1904;
-const BLUE                           = 0x1905;
-const ALPHA                          = 0x1906;
-const RGB                            = 0x1907;
-const RGBA                           = 0x1908;
-const POINT                          = 0x1B00;
-const LINE                           = 0x1B01;
-const FILL                           = 0x1B02;
-const KEEP                           = 0x1E00;
-const REPLACE                        = 0x1E01;
-const INCR                           = 0x1E02;
-const DECR                           = 0x1E03;
-const VENDOR                         = 0x1F00;
-const RENDERER                       = 0x1F01;
-const VERSION                        = 0x1F02;
-const EXTENSIONS                     = 0x1F03;
-const NEAREST                        = 0x2600;
-const LINEAR                         = 0x2601;
-const NEAREST_MIPMAP_NEAREST         = 0x2700;
-const LINEAR_MIPMAP_NEAREST          = 0x2701;
-const NEAREST_MIPMAP_LINEAR          = 0x2702;
-const LINEAR_MIPMAP_LINEAR           = 0x2703;
-const TEXTURE_MAG_FILTER             = 0x2800;
-const TEXTURE_MIN_FILTER             = 0x2801;
-const TEXTURE_WRAP_S                 = 0x2802;
-const TEXTURE_WRAP_T                 = 0x2803;
-const PROXY_TEXTURE_1D               = 0x8063;
-const PROXY_TEXTURE_2D               = 0x8064;
-const REPEAT                         = 0x2901;
-const R3_G3_B2                       = 0x2A10;
-const RGB4                           = 0x804F;
-const RGB5                           = 0x8050;
-const RGB8                           = 0x8051;
-const RGB10                          = 0x8052;
-const RGB12                          = 0x8053;
-const RGB16                          = 0x8054;
-const RGBA2                          = 0x8055;
-const RGBA4                          = 0x8056;
-const RGB5_A1                        = 0x8057;
-const RGBA8                          = 0x8058;
-const RGB10_A2                       = 0x8059;
-const RGBA12                         = 0x805A;
-const RGBA16                         = 0x805B;
-const VERTEX_ARRAY                   = 0x8074;
+	UNSIGNED_BYTE_3_3_2            = 0x8032;
+	UNSIGNED_SHORT_4_4_4_4         = 0x8033;
+	UNSIGNED_SHORT_5_5_5_1         = 0x8034;
+	UNSIGNED_INT_8_8_8_8           = 0x8035;
+	UNSIGNED_INT_10_10_10_2        = 0x8036;
+	TEXTURE_BINDING_3D             = 0x806A;
+	PACK_SKIP_IMAGES               = 0x806B;
+	PACK_IMAGE_HEIGHT              = 0x806C;
+	UNPACK_SKIP_IMAGES             = 0x806D;
+	UNPACK_IMAGE_HEIGHT            = 0x806E;
+	TEXTURE_3D                     = 0x806F;
+	PROXY_TEXTURE_3D               = 0x8070;
+	TEXTURE_DEPTH                  = 0x8071;
+	TEXTURE_WRAP_R                 = 0x8072;
+	MAX_3D_TEXTURE_SIZE            = 0x8073;
+	UNSIGNED_BYTE_2_3_3_REV        = 0x8362;
+	UNSIGNED_SHORT_5_6_5           = 0x8363;
+	UNSIGNED_SHORT_5_6_5_REV       = 0x8364;
+	UNSIGNED_SHORT_4_4_4_4_REV     = 0x8365;
+	UNSIGNED_SHORT_1_5_5_5_REV     = 0x8366;
+	UNSIGNED_INT_8_8_8_8_REV       = 0x8367;
+	UNSIGNED_INT_2_10_10_10_REV    = 0x8368;
+	BGR                            = 0x80E0;
+	BGRA                           = 0x80E1;
+	MAX_ELEMENTS_VERTICES          = 0x80E8;
+	MAX_ELEMENTS_INDICES           = 0x80E9;
+	CLAMP_TO_EDGE                  = 0x812F;
+	TEXTURE_MIN_LOD                = 0x813A;
+	TEXTURE_MAX_LOD                = 0x813B;
+	TEXTURE_BASE_LEVEL             = 0x813C;
+	TEXTURE_MAX_LEVEL              = 0x813D;
+	SMOOTH_POINT_SIZE_RANGE        = 0x0B12;
+	SMOOTH_POINT_SIZE_GRANULARITY  = 0x0B13;
+	SMOOTH_LINE_WIDTH_RANGE        = 0x0B22;
+	SMOOTH_LINE_WIDTH_GRANULARITY  = 0x0B23;
+	ALIASED_LINE_WIDTH_RANGE       = 0x846E;
 
-const UNSIGNED_BYTE_3_3_2            = 0x8032;
-const UNSIGNED_SHORT_4_4_4_4         = 0x8033;
-const UNSIGNED_SHORT_5_5_5_1         = 0x8034;
-const UNSIGNED_INT_8_8_8_8           = 0x8035;
-const UNSIGNED_INT_10_10_10_2        = 0x8036;
-const TEXTURE_BINDING_3D             = 0x806A;
-const PACK_SKIP_IMAGES               = 0x806B;
-const PACK_IMAGE_HEIGHT              = 0x806C;
-const UNPACK_SKIP_IMAGES             = 0x806D;
-const UNPACK_IMAGE_HEIGHT            = 0x806E;
-const TEXTURE_3D                     = 0x806F;
-const PROXY_TEXTURE_3D               = 0x8070;
-const TEXTURE_DEPTH                  = 0x8071;
-const TEXTURE_WRAP_R                 = 0x8072;
-const MAX_3D_TEXTURE_SIZE            = 0x8073;
-const UNSIGNED_BYTE_2_3_3_REV        = 0x8362;
-const UNSIGNED_SHORT_5_6_5           = 0x8363;
-const UNSIGNED_SHORT_5_6_5_REV       = 0x8364;
-const UNSIGNED_SHORT_4_4_4_4_REV     = 0x8365;
-const UNSIGNED_SHORT_1_5_5_5_REV     = 0x8366;
-const UNSIGNED_INT_8_8_8_8_REV       = 0x8367;
-const UNSIGNED_INT_2_10_10_10_REV    = 0x8368;
-const BGR                            = 0x80E0;
-const BGRA                           = 0x80E1;
-const MAX_ELEMENTS_VERTICES          = 0x80E8;
-const MAX_ELEMENTS_INDICES           = 0x80E9;
-const CLAMP_TO_EDGE                  = 0x812F;
-const TEXTURE_MIN_LOD                = 0x813A;
-const TEXTURE_MAX_LOD                = 0x813B;
-const TEXTURE_BASE_LEVEL             = 0x813C;
-const TEXTURE_MAX_LEVEL              = 0x813D;
-const SMOOTH_POINT_SIZE_RANGE        = 0x0B12;
-const SMOOTH_POINT_SIZE_GRANULARITY  = 0x0B13;
-const SMOOTH_LINE_WIDTH_RANGE        = 0x0B22;
-const SMOOTH_LINE_WIDTH_GRANULARITY  = 0x0B23;
-const ALIASED_LINE_WIDTH_RANGE       = 0x846E;
+	TEXTURE0                       = 0x84C0;
+	TEXTURE1                       = 0x84C1;
+	TEXTURE2                       = 0x84C2;
+	TEXTURE3                       = 0x84C3;
+	TEXTURE4                       = 0x84C4;
+	TEXTURE5                       = 0x84C5;
+	TEXTURE6                       = 0x84C6;
+	TEXTURE7                       = 0x84C7;
+	TEXTURE8                       = 0x84C8;
+	TEXTURE9                       = 0x84C9;
+	TEXTURE10                      = 0x84CA;
+	TEXTURE11                      = 0x84CB;
+	TEXTURE12                      = 0x84CC;
+	TEXTURE13                      = 0x84CD;
+	TEXTURE14                      = 0x84CE;
+	TEXTURE15                      = 0x84CF;
+	TEXTURE16                      = 0x84D0;
+	TEXTURE17                      = 0x84D1;
+	TEXTURE18                      = 0x84D2;
+	TEXTURE19                      = 0x84D3;
+	TEXTURE20                      = 0x84D4;
+	TEXTURE21                      = 0x84D5;
+	TEXTURE22                      = 0x84D6;
+	TEXTURE23                      = 0x84D7;
+	TEXTURE24                      = 0x84D8;
+	TEXTURE25                      = 0x84D9;
+	TEXTURE26                      = 0x84DA;
+	TEXTURE27                      = 0x84DB;
+	TEXTURE28                      = 0x84DC;
+	TEXTURE29                      = 0x84DD;
+	TEXTURE30                      = 0x84DE;
+	TEXTURE31                      = 0x84DF;
+	ACTIVE_TEXTURE                 = 0x84E0;
+	MULTISAMPLE                    = 0x809D;
+	SAMPLE_ALPHA_TO_COVERAGE       = 0x809E;
+	SAMPLE_ALPHA_TO_ONE            = 0x809F;
+	SAMPLE_COVERAGE                = 0x80A0;
+	SAMPLE_BUFFERS                 = 0x80A8;
+	SAMPLES                        = 0x80A9;
+	SAMPLE_COVERAGE_VALUE          = 0x80AA;
+	SAMPLE_COVERAGE_INVERT         = 0x80AB;
+	TEXTURE_CUBE_MAP               = 0x8513;
+	TEXTURE_BINDING_CUBE_MAP       = 0x8514;
+	TEXTURE_CUBE_MAP_POSITIVE_X    = 0x8515;
+	TEXTURE_CUBE_MAP_NEGATIVE_X    = 0x8516;
+	TEXTURE_CUBE_MAP_POSITIVE_Y    = 0x8517;
+	TEXTURE_CUBE_MAP_NEGATIVE_Y    = 0x8518;
+	TEXTURE_CUBE_MAP_POSITIVE_Z    = 0x8519;
+	TEXTURE_CUBE_MAP_NEGATIVE_Z    = 0x851A;
+	PROXY_TEXTURE_CUBE_MAP         = 0x851B;
+	MAX_CUBE_MAP_TEXTURE_SIZE      = 0x851C;
+	COMPRESSED_RGB                 = 0x84ED;
+	COMPRESSED_RGBA                = 0x84EE;
+	TEXTURE_COMPRESSION_HINT       = 0x84EF;
+	TEXTURE_COMPRESSED_IMAGE_SIZE  = 0x86A0;
+	TEXTURE_COMPRESSED             = 0x86A1;
+	NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2;
+	COMPRESSED_TEXTURE_FORMATS     = 0x86A3;
+	CLAMP_TO_BORDER                = 0x812D;
 
-const TEXTURE0                       = 0x84C0;
-const TEXTURE1                       = 0x84C1;
-const TEXTURE2                       = 0x84C2;
-const TEXTURE3                       = 0x84C3;
-const TEXTURE4                       = 0x84C4;
-const TEXTURE5                       = 0x84C5;
-const TEXTURE6                       = 0x84C6;
-const TEXTURE7                       = 0x84C7;
-const TEXTURE8                       = 0x84C8;
-const TEXTURE9                       = 0x84C9;
-const TEXTURE10                      = 0x84CA;
-const TEXTURE11                      = 0x84CB;
-const TEXTURE12                      = 0x84CC;
-const TEXTURE13                      = 0x84CD;
-const TEXTURE14                      = 0x84CE;
-const TEXTURE15                      = 0x84CF;
-const TEXTURE16                      = 0x84D0;
-const TEXTURE17                      = 0x84D1;
-const TEXTURE18                      = 0x84D2;
-const TEXTURE19                      = 0x84D3;
-const TEXTURE20                      = 0x84D4;
-const TEXTURE21                      = 0x84D5;
-const TEXTURE22                      = 0x84D6;
-const TEXTURE23                      = 0x84D7;
-const TEXTURE24                      = 0x84D8;
-const TEXTURE25                      = 0x84D9;
-const TEXTURE26                      = 0x84DA;
-const TEXTURE27                      = 0x84DB;
-const TEXTURE28                      = 0x84DC;
-const TEXTURE29                      = 0x84DD;
-const TEXTURE30                      = 0x84DE;
-const TEXTURE31                      = 0x84DF;
-const ACTIVE_TEXTURE                 = 0x84E0;
-const MULTISAMPLE                    = 0x809D;
-const SAMPLE_ALPHA_TO_COVERAGE       = 0x809E;
-const SAMPLE_ALPHA_TO_ONE            = 0x809F;
-const SAMPLE_COVERAGE                = 0x80A0;
-const SAMPLE_BUFFERS                 = 0x80A8;
-const SAMPLES                        = 0x80A9;
-const SAMPLE_COVERAGE_VALUE          = 0x80AA;
-const SAMPLE_COVERAGE_INVERT         = 0x80AB;
-const TEXTURE_CUBE_MAP               = 0x8513;
-const TEXTURE_BINDING_CUBE_MAP       = 0x8514;
-const TEXTURE_CUBE_MAP_POSITIVE_X    = 0x8515;
-const TEXTURE_CUBE_MAP_NEGATIVE_X    = 0x8516;
-const TEXTURE_CUBE_MAP_POSITIVE_Y    = 0x8517;
-const TEXTURE_CUBE_MAP_NEGATIVE_Y    = 0x8518;
-const TEXTURE_CUBE_MAP_POSITIVE_Z    = 0x8519;
-const TEXTURE_CUBE_MAP_NEGATIVE_Z    = 0x851A;
-const PROXY_TEXTURE_CUBE_MAP         = 0x851B;
-const MAX_CUBE_MAP_TEXTURE_SIZE      = 0x851C;
-const COMPRESSED_RGB                 = 0x84ED;
-const COMPRESSED_RGBA                = 0x84EE;
-const TEXTURE_COMPRESSION_HINT       = 0x84EF;
-const TEXTURE_COMPRESSED_IMAGE_SIZE  = 0x86A0;
-const TEXTURE_COMPRESSED             = 0x86A1;
-const NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2;
-const COMPRESSED_TEXTURE_FORMATS     = 0x86A3;
-const CLAMP_TO_BORDER                = 0x812D;
+	BLEND_DST_RGB                  = 0x80C8;
+	BLEND_SRC_RGB                  = 0x80C9;
+	BLEND_DST_ALPHA                = 0x80CA;
+	BLEND_SRC_ALPHA                = 0x80CB;
+	POINT_FADE_THRESHOLD_SIZE      = 0x8128;
+	DEPTH_COMPONENT16              = 0x81A5;
+	DEPTH_COMPONENT24              = 0x81A6;
+	DEPTH_COMPONENT32              = 0x81A7;
+	MIRRORED_REPEAT                = 0x8370;
+	MAX_TEXTURE_LOD_BIAS           = 0x84FD;
+	TEXTURE_LOD_BIAS               = 0x8501;
+	INCR_WRAP                      = 0x8507;
+	DECR_WRAP                      = 0x8508;
+	TEXTURE_DEPTH_SIZE             = 0x884A;
+	TEXTURE_COMPARE_MODE           = 0x884C;
+	TEXTURE_COMPARE_FUNC           = 0x884D;
+	FUNC_ADD                       = 0x8006;
+	FUNC_SUBTRACT                  = 0x800A;
+	FUNC_REVERSE_SUBTRACT          = 0x800B;
+	MIN                            = 0x8007;
+	MAX                            = 0x8008;
+	CONSTANT_COLOR                 = 0x8001;
+	ONE_MINUS_CONSTANT_COLOR       = 0x8002;
+	CONSTANT_ALPHA                 = 0x8003;
+	ONE_MINUS_CONSTANT_ALPHA       = 0x8004;
 
-const BLEND_DST_RGB                  = 0x80C8;
-const BLEND_SRC_RGB                  = 0x80C9;
-const BLEND_DST_ALPHA                = 0x80CA;
-const BLEND_SRC_ALPHA                = 0x80CB;
-const POINT_FADE_THRESHOLD_SIZE      = 0x8128;
-const DEPTH_COMPONENT16              = 0x81A5;
-const DEPTH_COMPONENT24              = 0x81A6;
-const DEPTH_COMPONENT32              = 0x81A7;
-const MIRRORED_REPEAT                = 0x8370;
-const MAX_TEXTURE_LOD_BIAS           = 0x84FD;
-const TEXTURE_LOD_BIAS               = 0x8501;
-const INCR_WRAP                      = 0x8507;
-const DECR_WRAP                      = 0x8508;
-const TEXTURE_DEPTH_SIZE             = 0x884A;
-const TEXTURE_COMPARE_MODE           = 0x884C;
-const TEXTURE_COMPARE_FUNC           = 0x884D;
-const FUNC_ADD                       = 0x8006;
-const FUNC_SUBTRACT                  = 0x800A;
-const FUNC_REVERSE_SUBTRACT          = 0x800B;
-const MIN                            = 0x8007;
-const MAX                            = 0x8008;
-const CONSTANT_COLOR                 = 0x8001;
-const ONE_MINUS_CONSTANT_COLOR       = 0x8002;
-const CONSTANT_ALPHA                 = 0x8003;
-const ONE_MINUS_CONSTANT_ALPHA       = 0x8004;
+	BUFFER_SIZE                    = 0x8764;
+	BUFFER_USAGE                   = 0x8765;
+	QUERY_COUNTER_BITS             = 0x8864;
+	CURRENT_QUERY                  = 0x8865;
+	QUERY_RESULT                   = 0x8866;
+	QUERY_RESULT_AVAILABLE         = 0x8867;
+	ARRAY_BUFFER                   = 0x8892;
+	ELEMENT_ARRAY_BUFFER           = 0x8893;
+	ARRAY_BUFFER_BINDING           = 0x8894;
+	ELEMENT_ARRAY_BUFFER_BINDING   = 0x8895;
+	VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F;
+	READ_ONLY                      = 0x88B8;
+	WRITE_ONLY                     = 0x88B9;
+	READ_WRITE                     = 0x88BA;
+	BUFFER_ACCESS                  = 0x88BB;
+	BUFFER_MAPPED                  = 0x88BC;
+	BUFFER_MAP_POINTER             = 0x88BD;
+	STREAM_DRAW                    = 0x88E0;
+	STREAM_READ                    = 0x88E1;
+	STREAM_COPY                    = 0x88E2;
+	STATIC_DRAW                    = 0x88E4;
+	STATIC_READ                    = 0x88E5;
+	STATIC_COPY                    = 0x88E6;
+	DYNAMIC_DRAW                   = 0x88E8;
+	DYNAMIC_READ                   = 0x88E9;
+	DYNAMIC_COPY                   = 0x88EA;
+	SAMPLES_PASSED                 = 0x8914;
+	SRC1_ALPHA                     = 0x8589;
 
-const BUFFER_SIZE                    = 0x8764;
-const BUFFER_USAGE                   = 0x8765;
-const QUERY_COUNTER_BITS             = 0x8864;
-const CURRENT_QUERY                  = 0x8865;
-const QUERY_RESULT                   = 0x8866;
-const QUERY_RESULT_AVAILABLE         = 0x8867;
-const ARRAY_BUFFER                   = 0x8892;
-const ELEMENT_ARRAY_BUFFER           = 0x8893;
-const ARRAY_BUFFER_BINDING           = 0x8894;
-const ELEMENT_ARRAY_BUFFER_BINDING   = 0x8895;
-const VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F;
-const READ_ONLY                      = 0x88B8;
-const WRITE_ONLY                     = 0x88B9;
-const READ_WRITE                     = 0x88BA;
-const BUFFER_ACCESS                  = 0x88BB;
-const BUFFER_MAPPED                  = 0x88BC;
-const BUFFER_MAP_POINTER             = 0x88BD;
-const STREAM_DRAW                    = 0x88E0;
-const STREAM_READ                    = 0x88E1;
-const STREAM_COPY                    = 0x88E2;
-const STATIC_DRAW                    = 0x88E4;
-const STATIC_READ                    = 0x88E5;
-const STATIC_COPY                    = 0x88E6;
-const DYNAMIC_DRAW                   = 0x88E8;
-const DYNAMIC_READ                   = 0x88E9;
-const DYNAMIC_COPY                   = 0x88EA;
-const SAMPLES_PASSED                 = 0x8914;
-const SRC1_ALPHA                     = 0x8589;
+	BLEND_EQUATION_RGB             = 0x8009;
+	VERTEX_ATTRIB_ARRAY_ENABLED    = 0x8622;
+	VERTEX_ATTRIB_ARRAY_SIZE       = 0x8623;
+	VERTEX_ATTRIB_ARRAY_STRIDE     = 0x8624;
+	VERTEX_ATTRIB_ARRAY_TYPE       = 0x8625;
+	CURRENT_VERTEX_ATTRIB          = 0x8626;
+	VERTEX_PROGRAM_POINT_SIZE      = 0x8642;
+	VERTEX_ATTRIB_ARRAY_POINTER    = 0x8645;
+	STENCIL_BACK_FUNC              = 0x8800;
+	STENCIL_BACK_FAIL              = 0x8801;
+	STENCIL_BACK_PASS_DEPTH_FAIL   = 0x8802;
+	STENCIL_BACK_PASS_DEPTH_PASS   = 0x8803;
+	MAX_DRAW_BUFFERS               = 0x8824;
+	DRAW_BUFFER0                   = 0x8825;
+	DRAW_BUFFER1                   = 0x8826;
+	DRAW_BUFFER2                   = 0x8827;
+	DRAW_BUFFER3                   = 0x8828;
+	DRAW_BUFFER4                   = 0x8829;
+	DRAW_BUFFER5                   = 0x882A;
+	DRAW_BUFFER6                   = 0x882B;
+	DRAW_BUFFER7                   = 0x882C;
+	DRAW_BUFFER8                   = 0x882D;
+	DRAW_BUFFER9                   = 0x882E;
+	DRAW_BUFFER10                  = 0x882F;
+	DRAW_BUFFER11                  = 0x8830;
+	DRAW_BUFFER12                  = 0x8831;
+	DRAW_BUFFER13                  = 0x8832;
+	DRAW_BUFFER14                  = 0x8833;
+	DRAW_BUFFER15                  = 0x8834;
+	BLEND_EQUATION_ALPHA           = 0x883D;
+	MAX_VERTEX_ATTRIBS             = 0x8869;
+	VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A;
+	MAX_TEXTURE_IMAGE_UNITS        = 0x8872;
+	FRAGMENT_SHADER                = 0x8B30;
+	VERTEX_SHADER                  = 0x8B31;
+	MAX_FRAGMENT_UNIFORM_COMPONENTS = 0x8B49;
+	MAX_VERTEX_UNIFORM_COMPONENTS  = 0x8B4A;
+	MAX_VARYING_FLOATS             = 0x8B4B;
+	MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C;
+	MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D;
+	SHADER_TYPE                    = 0x8B4F;
+	FLOAT_VEC2                     = 0x8B50;
+	FLOAT_VEC3                     = 0x8B51;
+	FLOAT_VEC4                     = 0x8B52;
+	INT_VEC2                       = 0x8B53;
+	INT_VEC3                       = 0x8B54;
+	INT_VEC4                       = 0x8B55;
+	BOOL                           = 0x8B56;
+	BOOL_VEC2                      = 0x8B57;
+	BOOL_VEC3                      = 0x8B58;
+	BOOL_VEC4                      = 0x8B59;
+	FLOAT_MAT2                     = 0x8B5A;
+	FLOAT_MAT3                     = 0x8B5B;
+	FLOAT_MAT4                     = 0x8B5C;
+	SAMPLER_1D                     = 0x8B5D;
+	SAMPLER_2D                     = 0x8B5E;
+	SAMPLER_3D                     = 0x8B5F;
+	SAMPLER_CUBE                   = 0x8B60;
+	SAMPLER_1D_SHADOW              = 0x8B61;
+	SAMPLER_2D_SHADOW              = 0x8B62;
+	DELETE_STATUS                  = 0x8B80;
+	COMPILE_STATUS                 = 0x8B81;
+	LINK_STATUS                    = 0x8B82;
+	VALIDATE_STATUS                = 0x8B83;
+	INFO_LOG_LENGTH                = 0x8B84;
+	ATTACHED_SHADERS               = 0x8B85;
+	ACTIVE_UNIFORMS                = 0x8B86;
+	ACTIVE_UNIFORM_MAX_LENGTH      = 0x8B87;
+	SHADER_SOURCE_LENGTH           = 0x8B88;
+	ACTIVE_ATTRIBUTES              = 0x8B89;
+	ACTIVE_ATTRIBUTE_MAX_LENGTH    = 0x8B8A;
+	FRAGMENT_SHADER_DERIVATIVE_HINT = 0x8B8B;
+	SHADING_LANGUAGE_VERSION       = 0x8B8C;
+	CURRENT_PROGRAM                = 0x8B8D;
+	POINT_SPRITE_COORD_ORIGIN      = 0x8CA0;
+	LOWER_LEFT                     = 0x8CA1;
+	UPPER_LEFT                     = 0x8CA2;
+	STENCIL_BACK_REF               = 0x8CA3;
+	STENCIL_BACK_VALUE_MASK        = 0x8CA4;
+	STENCIL_BACK_WRITEMASK         = 0x8CA5;
 
-const BLEND_EQUATION_RGB             = 0x8009;
-const VERTEX_ATTRIB_ARRAY_ENABLED    = 0x8622;
-const VERTEX_ATTRIB_ARRAY_SIZE       = 0x8623;
-const VERTEX_ATTRIB_ARRAY_STRIDE     = 0x8624;
-const VERTEX_ATTRIB_ARRAY_TYPE       = 0x8625;
-const CURRENT_VERTEX_ATTRIB          = 0x8626;
-const VERTEX_PROGRAM_POINT_SIZE      = 0x8642;
-const VERTEX_ATTRIB_ARRAY_POINTER    = 0x8645;
-const STENCIL_BACK_FUNC              = 0x8800;
-const STENCIL_BACK_FAIL              = 0x8801;
-const STENCIL_BACK_PASS_DEPTH_FAIL   = 0x8802;
-const STENCIL_BACK_PASS_DEPTH_PASS   = 0x8803;
-const MAX_DRAW_BUFFERS               = 0x8824;
-const DRAW_BUFFER0                   = 0x8825;
-const DRAW_BUFFER1                   = 0x8826;
-const DRAW_BUFFER2                   = 0x8827;
-const DRAW_BUFFER3                   = 0x8828;
-const DRAW_BUFFER4                   = 0x8829;
-const DRAW_BUFFER5                   = 0x882A;
-const DRAW_BUFFER6                   = 0x882B;
-const DRAW_BUFFER7                   = 0x882C;
-const DRAW_BUFFER8                   = 0x882D;
-const DRAW_BUFFER9                   = 0x882E;
-const DRAW_BUFFER10                  = 0x882F;
-const DRAW_BUFFER11                  = 0x8830;
-const DRAW_BUFFER12                  = 0x8831;
-const DRAW_BUFFER13                  = 0x8832;
-const DRAW_BUFFER14                  = 0x8833;
-const DRAW_BUFFER15                  = 0x8834;
-const BLEND_EQUATION_ALPHA           = 0x883D;
-const MAX_VERTEX_ATTRIBS             = 0x8869;
-const VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A;
-const MAX_TEXTURE_IMAGE_UNITS        = 0x8872;
-const FRAGMENT_SHADER                = 0x8B30;
-const VERTEX_SHADER                  = 0x8B31;
-const MAX_FRAGMENT_UNIFORM_COMPONENTS = 0x8B49;
-const MAX_VERTEX_UNIFORM_COMPONENTS  = 0x8B4A;
-const MAX_VARYING_FLOATS             = 0x8B4B;
-const MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C;
-const MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D;
-const SHADER_TYPE                    = 0x8B4F;
-const FLOAT_VEC2                     = 0x8B50;
-const FLOAT_VEC3                     = 0x8B51;
-const FLOAT_VEC4                     = 0x8B52;
-const INT_VEC2                       = 0x8B53;
-const INT_VEC3                       = 0x8B54;
-const INT_VEC4                       = 0x8B55;
-const BOOL                           = 0x8B56;
-const BOOL_VEC2                      = 0x8B57;
-const BOOL_VEC3                      = 0x8B58;
-const BOOL_VEC4                      = 0x8B59;
-const FLOAT_MAT2                     = 0x8B5A;
-const FLOAT_MAT3                     = 0x8B5B;
-const FLOAT_MAT4                     = 0x8B5C;
-const SAMPLER_1D                     = 0x8B5D;
-const SAMPLER_2D                     = 0x8B5E;
-const SAMPLER_3D                     = 0x8B5F;
-const SAMPLER_CUBE                   = 0x8B60;
-const SAMPLER_1D_SHADOW              = 0x8B61;
-const SAMPLER_2D_SHADOW              = 0x8B62;
-const DELETE_STATUS                  = 0x8B80;
-const COMPILE_STATUS                 = 0x8B81;
-const LINK_STATUS                    = 0x8B82;
-const VALIDATE_STATUS                = 0x8B83;
-const INFO_LOG_LENGTH                = 0x8B84;
-const ATTACHED_SHADERS               = 0x8B85;
-const ACTIVE_UNIFORMS                = 0x8B86;
-const ACTIVE_UNIFORM_MAX_LENGTH      = 0x8B87;
-const SHADER_SOURCE_LENGTH           = 0x8B88;
-const ACTIVE_ATTRIBUTES              = 0x8B89;
-const ACTIVE_ATTRIBUTE_MAX_LENGTH    = 0x8B8A;
-const FRAGMENT_SHADER_DERIVATIVE_HINT = 0x8B8B;
-const SHADING_LANGUAGE_VERSION       = 0x8B8C;
-const CURRENT_PROGRAM                = 0x8B8D;
-const POINT_SPRITE_COORD_ORIGIN      = 0x8CA0;
-const LOWER_LEFT                     = 0x8CA1;
-const UPPER_LEFT                     = 0x8CA2;
-const STENCIL_BACK_REF               = 0x8CA3;
-const STENCIL_BACK_VALUE_MASK        = 0x8CA4;
-const STENCIL_BACK_WRITEMASK         = 0x8CA5;
+	PIXEL_PACK_BUFFER              = 0x88EB;
+	PIXEL_UNPACK_BUFFER            = 0x88EC;
+	PIXEL_PACK_BUFFER_BINDING      = 0x88ED;
+	PIXEL_UNPACK_BUFFER_BINDING    = 0x88EF;
+	FLOAT_MAT2x3                   = 0x8B65;
+	FLOAT_MAT2x4                   = 0x8B66;
+	FLOAT_MAT3x2                   = 0x8B67;
+	FLOAT_MAT3x4                   = 0x8B68;
+	FLOAT_MAT4x2                   = 0x8B69;
+	FLOAT_MAT4x3                   = 0x8B6A;
+	SRGB                           = 0x8C40;
+	SRGB8                          = 0x8C41;
+	SRGB_ALPHA                     = 0x8C42;
+	SRGB8_ALPHA8                   = 0x8C43;
+	COMPRESSED_SRGB                = 0x8C48;
+	COMPRESSED_SRGB_ALPHA          = 0x8C49;
 
-const PIXEL_PACK_BUFFER              = 0x88EB;
-const PIXEL_UNPACK_BUFFER            = 0x88EC;
-const PIXEL_PACK_BUFFER_BINDING      = 0x88ED;
-const PIXEL_UNPACK_BUFFER_BINDING    = 0x88EF;
-const FLOAT_MAT2x3                   = 0x8B65;
-const FLOAT_MAT2x4                   = 0x8B66;
-const FLOAT_MAT3x2                   = 0x8B67;
-const FLOAT_MAT3x4                   = 0x8B68;
-const FLOAT_MAT4x2                   = 0x8B69;
-const FLOAT_MAT4x3                   = 0x8B6A;
-const SRGB                           = 0x8C40;
-const SRGB8                          = 0x8C41;
-const SRGB_ALPHA                     = 0x8C42;
-const SRGB8_ALPHA8                   = 0x8C43;
-const COMPRESSED_SRGB                = 0x8C48;
-const COMPRESSED_SRGB_ALPHA          = 0x8C49;
+	COMPARE_REF_TO_TEXTURE         = 0x884E;
+	CLIP_DISTANCE0                 = 0x3000;
+	CLIP_DISTANCE1                 = 0x3001;
+	CLIP_DISTANCE2                 = 0x3002;
+	CLIP_DISTANCE3                 = 0x3003;
+	CLIP_DISTANCE4                 = 0x3004;
+	CLIP_DISTANCE5                 = 0x3005;
+	CLIP_DISTANCE6                 = 0x3006;
+	CLIP_DISTANCE7                 = 0x3007;
+	MAX_CLIP_DISTANCES             = 0x0D32;
+	MAJOR_VERSION                  = 0x821B;
+	MINOR_VERSION                  = 0x821C;
+	NUM_EXTENSIONS                 = 0x821D;
+	CONTEXT_FLAGS                  = 0x821E;
+	COMPRESSED_RED                 = 0x8225;
+	COMPRESSED_RG                  = 0x8226;
+	CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT = 0x00000001;
+	RGBA32F                        = 0x8814;
+	RGB32F                         = 0x8815;
+	RGBA16F                        = 0x881A;
+	RGB16F                         = 0x881B;
+	VERTEX_ATTRIB_ARRAY_INTEGER    = 0x88FD;
+	MAX_ARRAY_TEXTURE_LAYERS       = 0x88FF;
+	MIN_PROGRAM_TEXEL_OFFSET       = 0x8904;
+	MAX_PROGRAM_TEXEL_OFFSET       = 0x8905;
+	CLAMP_READ_COLOR               = 0x891C;
+	FIXED_ONLY                     = 0x891D;
+	MAX_VARYING_COMPONENTS         = 0x8B4B;
+	TEXTURE_1D_ARRAY               = 0x8C18;
+	PROXY_TEXTURE_1D_ARRAY         = 0x8C19;
+	TEXTURE_2D_ARRAY               = 0x8C1A;
+	PROXY_TEXTURE_2D_ARRAY         = 0x8C1B;
+	TEXTURE_BINDING_1D_ARRAY       = 0x8C1C;
+	TEXTURE_BINDING_2D_ARRAY       = 0x8C1D;
+	R11F_G11F_B10F                 = 0x8C3A;
+	UNSIGNED_INT_10F_11F_11F_REV   = 0x8C3B;
+	RGB9_E5                        = 0x8C3D;
+	UNSIGNED_INT_5_9_9_9_REV       = 0x8C3E;
+	TEXTURE_SHARED_SIZE            = 0x8C3F;
+	TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH = 0x8C76;
+	TRANSFORM_FEEDBACK_BUFFER_MODE = 0x8C7F;
+	MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 0x8C80;
+	TRANSFORM_FEEDBACK_VARYINGS    = 0x8C83;
+	TRANSFORM_FEEDBACK_BUFFER_START = 0x8C84;
+	TRANSFORM_FEEDBACK_BUFFER_SIZE = 0x8C85;
+	PRIMITIVES_GENERATED           = 0x8C87;
+	TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 0x8C88;
+	RASTERIZER_DISCARD             = 0x8C89;
+	MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 0x8C8A;
+	MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 0x8C8B;
+	INTERLEAVED_ATTRIBS            = 0x8C8C;
+	SEPARATE_ATTRIBS               = 0x8C8D;
+	TRANSFORM_FEEDBACK_BUFFER      = 0x8C8E;
+	TRANSFORM_FEEDBACK_BUFFER_BINDING = 0x8C8F;
+	RGBA32UI                       = 0x8D70;
+	RGB32UI                        = 0x8D71;
+	RGBA16UI                       = 0x8D76;
+	RGB16UI                        = 0x8D77;
+	RGBA8UI                        = 0x8D7C;
+	RGB8UI                         = 0x8D7D;
+	RGBA32I                        = 0x8D82;
+	RGB32I                         = 0x8D83;
+	RGBA16I                        = 0x8D88;
+	RGB16I                         = 0x8D89;
+	RGBA8I                         = 0x8D8E;
+	RGB8I                          = 0x8D8F;
+	RED_INTEGER                    = 0x8D94;
+	GREEN_INTEGER                  = 0x8D95;
+	BLUE_INTEGER                   = 0x8D96;
+	RGB_INTEGER                    = 0x8D98;
+	RGBA_INTEGER                   = 0x8D99;
+	BGR_INTEGER                    = 0x8D9A;
+	BGRA_INTEGER                   = 0x8D9B;
+	SAMPLER_1D_ARRAY               = 0x8DC0;
+	SAMPLER_2D_ARRAY               = 0x8DC1;
+	SAMPLER_1D_ARRAY_SHADOW        = 0x8DC3;
+	SAMPLER_2D_ARRAY_SHADOW        = 0x8DC4;
+	SAMPLER_CUBE_SHADOW            = 0x8DC5;
+	UNSIGNED_INT_VEC2              = 0x8DC6;
+	UNSIGNED_INT_VEC3              = 0x8DC7;
+	UNSIGNED_INT_VEC4              = 0x8DC8;
+	INT_SAMPLER_1D                 = 0x8DC9;
+	INT_SAMPLER_2D                 = 0x8DCA;
+	INT_SAMPLER_3D                 = 0x8DCB;
+	INT_SAMPLER_CUBE               = 0x8DCC;
+	INT_SAMPLER_1D_ARRAY           = 0x8DCE;
+	INT_SAMPLER_2D_ARRAY           = 0x8DCF;
+	UNSIGNED_INT_SAMPLER_1D        = 0x8DD1;
+	UNSIGNED_INT_SAMPLER_2D        = 0x8DD2;
+	UNSIGNED_INT_SAMPLER_3D        = 0x8DD3;
+	UNSIGNED_INT_SAMPLER_CUBE      = 0x8DD4;
+	UNSIGNED_INT_SAMPLER_1D_ARRAY  = 0x8DD6;
+	UNSIGNED_INT_SAMPLER_2D_ARRAY  = 0x8DD7;
+	QUERY_WAIT                     = 0x8E13;
+	QUERY_NO_WAIT                  = 0x8E14;
+	QUERY_BY_REGION_WAIT           = 0x8E15;
+	QUERY_BY_REGION_NO_WAIT        = 0x8E16;
+	BUFFER_ACCESS_FLAGS            = 0x911F;
+	BUFFER_MAP_LENGTH              = 0x9120;
+	BUFFER_MAP_OFFSET              = 0x9121;
+	DEPTH_COMPONENT32F             = 0x8CAC;
+	DEPTH32F_STENCIL8              = 0x8CAD;
+	FLOAT_32_UNSIGNED_INT_24_8_REV = 0x8DAD;
+	INVALID_FRAMEBUFFER_OPERATION  = 0x0506;
+	FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 0x8210;
+	FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 0x8211;
+	FRAMEBUFFER_ATTACHMENT_RED_SIZE = 0x8212;
+	FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 0x8213;
+	FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 0x8214;
+	FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 0x8215;
+	FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 0x8216;
+	FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 0x8217;
+	FRAMEBUFFER_DEFAULT            = 0x8218;
+	FRAMEBUFFER_UNDEFINED          = 0x8219;
+	DEPTH_STENCIL_ATTACHMENT       = 0x821A;
+	MAX_RENDERBUFFER_SIZE          = 0x84E8;
+	DEPTH_STENCIL                  = 0x84F9;
+	UNSIGNED_INT_24_8              = 0x84FA;
+	DEPTH24_STENCIL8               = 0x88F0;
+	TEXTURE_STENCIL_SIZE           = 0x88F1;
+	TEXTURE_RED_TYPE               = 0x8C10;
+	TEXTURE_GREEN_TYPE             = 0x8C11;
+	TEXTURE_BLUE_TYPE              = 0x8C12;
+	TEXTURE_ALPHA_TYPE             = 0x8C13;
+	TEXTURE_DEPTH_TYPE             = 0x8C16;
+	UNSIGNED_NORMALIZED            = 0x8C17;
+	FRAMEBUFFER_BINDING            = 0x8CA6;
+	DRAW_FRAMEBUFFER_BINDING       = 0x8CA6;
+	RENDERBUFFER_BINDING           = 0x8CA7;
+	READ_FRAMEBUFFER               = 0x8CA8;
+	DRAW_FRAMEBUFFER               = 0x8CA9;
+	READ_FRAMEBUFFER_BINDING       = 0x8CAA;
+	RENDERBUFFER_SAMPLES           = 0x8CAB;
+	FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0;
+	FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1;
+	FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2;
+	FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3;
+	FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 0x8CD4;
+	FRAMEBUFFER_COMPLETE           = 0x8CD5;
+	FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6;
+	FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7;
+	FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER = 0x8CDB;
+	FRAMEBUFFER_INCOMPLETE_READ_BUFFER = 0x8CDC;
+	FRAMEBUFFER_UNSUPPORTED        = 0x8CDD;
+	MAX_COLOR_ATTACHMENTS          = 0x8CDF;
+	COLOR_ATTACHMENT0              = 0x8CE0;
+	COLOR_ATTACHMENT1              = 0x8CE1;
+	COLOR_ATTACHMENT2              = 0x8CE2;
+	COLOR_ATTACHMENT3              = 0x8CE3;
+	COLOR_ATTACHMENT4              = 0x8CE4;
+	COLOR_ATTACHMENT5              = 0x8CE5;
+	COLOR_ATTACHMENT6              = 0x8CE6;
+	COLOR_ATTACHMENT7              = 0x8CE7;
+	COLOR_ATTACHMENT8              = 0x8CE8;
+	COLOR_ATTACHMENT9              = 0x8CE9;
+	COLOR_ATTACHMENT10             = 0x8CEA;
+	COLOR_ATTACHMENT11             = 0x8CEB;
+	COLOR_ATTACHMENT12             = 0x8CEC;
+	COLOR_ATTACHMENT13             = 0x8CED;
+	COLOR_ATTACHMENT14             = 0x8CEE;
+	COLOR_ATTACHMENT15             = 0x8CEF;
+	COLOR_ATTACHMENT16             = 0x8CF0;
+	COLOR_ATTACHMENT17             = 0x8CF1;
+	COLOR_ATTACHMENT18             = 0x8CF2;
+	COLOR_ATTACHMENT19             = 0x8CF3;
+	COLOR_ATTACHMENT20             = 0x8CF4;
+	COLOR_ATTACHMENT21             = 0x8CF5;
+	COLOR_ATTACHMENT22             = 0x8CF6;
+	COLOR_ATTACHMENT23             = 0x8CF7;
+	COLOR_ATTACHMENT24             = 0x8CF8;
+	COLOR_ATTACHMENT25             = 0x8CF9;
+	COLOR_ATTACHMENT26             = 0x8CFA;
+	COLOR_ATTACHMENT27             = 0x8CFB;
+	COLOR_ATTACHMENT28             = 0x8CFC;
+	COLOR_ATTACHMENT29             = 0x8CFD;
+	COLOR_ATTACHMENT30             = 0x8CFE;
+	COLOR_ATTACHMENT31             = 0x8CFF;
+	DEPTH_ATTACHMENT               = 0x8D00;
+	STENCIL_ATTACHMENT             = 0x8D20;
+	FRAMEBUFFER                    = 0x8D40;
+	RENDERBUFFER                   = 0x8D41;
+	RENDERBUFFER_WIDTH             = 0x8D42;
+	RENDERBUFFER_HEIGHT            = 0x8D43;
+	RENDERBUFFER_INTERNAL_FORMAT   = 0x8D44;
+	STENCIL_INDEX1                 = 0x8D46;
+	STENCIL_INDEX4                 = 0x8D47;
+	STENCIL_INDEX8                 = 0x8D48;
+	STENCIL_INDEX16                = 0x8D49;
+	RENDERBUFFER_RED_SIZE          = 0x8D50;
+	RENDERBUFFER_GREEN_SIZE        = 0x8D51;
+	RENDERBUFFER_BLUE_SIZE         = 0x8D52;
+	RENDERBUFFER_ALPHA_SIZE        = 0x8D53;
+	RENDERBUFFER_DEPTH_SIZE        = 0x8D54;
+	RENDERBUFFER_STENCIL_SIZE      = 0x8D55;
+	FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 0x8D56;
+	MAX_SAMPLES                    = 0x8D57;
+	FRAMEBUFFER_SRGB               = 0x8DB9;
+	HALF_FLOAT                     = 0x140B;
+	MAP_READ_BIT                   = 0x0001;
+	MAP_WRITE_BIT                  = 0x0002;
+	MAP_INVALIDATE_RANGE_BIT       = 0x0004;
+	MAP_INVALIDATE_BUFFER_BIT      = 0x0008;
+	MAP_FLUSH_EXPLICIT_BIT         = 0x0010;
+	MAP_UNSYNCHRONIZED_BIT         = 0x0020;
+	COMPRESSED_RED_RGTC1           = 0x8DBB;
+	COMPRESSED_SIGNED_RED_RGTC1    = 0x8DBC;
+	COMPRESSED_RG_RGTC2            = 0x8DBD;
+	COMPRESSED_SIGNED_RG_RGTC2     = 0x8DBE;
+	RG                             = 0x8227;
+	RG_INTEGER                     = 0x8228;
+	R8                             = 0x8229;
+	R16                            = 0x822A;
+	RG8                            = 0x822B;
+	RG16                           = 0x822C;
+	R16F                           = 0x822D;
+	R32F                           = 0x822E;
+	RG16F                          = 0x822F;
+	RG32F                          = 0x8230;
+	R8I                            = 0x8231;
+	R8UI                           = 0x8232;
+	R16I                           = 0x8233;
+	R16UI                          = 0x8234;
+	R32I                           = 0x8235;
+	R32UI                          = 0x8236;
+	RG8I                           = 0x8237;
+	RG8UI                          = 0x8238;
+	RG16I                          = 0x8239;
+	RG16UI                         = 0x823A;
+	RG32I                          = 0x823B;
+	RG32UI                         = 0x823C;
+	VERTEX_ARRAY_BINDING           = 0x85B5;
 
-const COMPARE_REF_TO_TEXTURE         = 0x884E;
-const CLIP_DISTANCE0                 = 0x3000;
-const CLIP_DISTANCE1                 = 0x3001;
-const CLIP_DISTANCE2                 = 0x3002;
-const CLIP_DISTANCE3                 = 0x3003;
-const CLIP_DISTANCE4                 = 0x3004;
-const CLIP_DISTANCE5                 = 0x3005;
-const CLIP_DISTANCE6                 = 0x3006;
-const CLIP_DISTANCE7                 = 0x3007;
-const MAX_CLIP_DISTANCES             = 0x0D32;
-const MAJOR_VERSION                  = 0x821B;
-const MINOR_VERSION                  = 0x821C;
-const NUM_EXTENSIONS                 = 0x821D;
-const CONTEXT_FLAGS                  = 0x821E;
-const COMPRESSED_RED                 = 0x8225;
-const COMPRESSED_RG                  = 0x8226;
-const CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT = 0x00000001;
-const RGBA32F                        = 0x8814;
-const RGB32F                         = 0x8815;
-const RGBA16F                        = 0x881A;
-const RGB16F                         = 0x881B;
-const VERTEX_ATTRIB_ARRAY_INTEGER    = 0x88FD;
-const MAX_ARRAY_TEXTURE_LAYERS       = 0x88FF;
-const MIN_PROGRAM_TEXEL_OFFSET       = 0x8904;
-const MAX_PROGRAM_TEXEL_OFFSET       = 0x8905;
-const CLAMP_READ_COLOR               = 0x891C;
-const FIXED_ONLY                     = 0x891D;
-const MAX_VARYING_COMPONENTS         = 0x8B4B;
-const TEXTURE_1D_ARRAY               = 0x8C18;
-const PROXY_TEXTURE_1D_ARRAY         = 0x8C19;
-const TEXTURE_2D_ARRAY               = 0x8C1A;
-const PROXY_TEXTURE_2D_ARRAY         = 0x8C1B;
-const TEXTURE_BINDING_1D_ARRAY       = 0x8C1C;
-const TEXTURE_BINDING_2D_ARRAY       = 0x8C1D;
-const R11F_G11F_B10F                 = 0x8C3A;
-const UNSIGNED_INT_10F_11F_11F_REV   = 0x8C3B;
-const RGB9_E5                        = 0x8C3D;
-const UNSIGNED_INT_5_9_9_9_REV       = 0x8C3E;
-const TEXTURE_SHARED_SIZE            = 0x8C3F;
-const TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH = 0x8C76;
-const TRANSFORM_FEEDBACK_BUFFER_MODE = 0x8C7F;
-const MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 0x8C80;
-const TRANSFORM_FEEDBACK_VARYINGS    = 0x8C83;
-const TRANSFORM_FEEDBACK_BUFFER_START = 0x8C84;
-const TRANSFORM_FEEDBACK_BUFFER_SIZE = 0x8C85;
-const PRIMITIVES_GENERATED           = 0x8C87;
-const TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 0x8C88;
-const RASTERIZER_DISCARD             = 0x8C89;
-const MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 0x8C8A;
-const MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 0x8C8B;
-const INTERLEAVED_ATTRIBS            = 0x8C8C;
-const SEPARATE_ATTRIBS               = 0x8C8D;
-const TRANSFORM_FEEDBACK_BUFFER      = 0x8C8E;
-const TRANSFORM_FEEDBACK_BUFFER_BINDING = 0x8C8F;
-const RGBA32UI                       = 0x8D70;
-const RGB32UI                        = 0x8D71;
-const RGBA16UI                       = 0x8D76;
-const RGB16UI                        = 0x8D77;
-const RGBA8UI                        = 0x8D7C;
-const RGB8UI                         = 0x8D7D;
-const RGBA32I                        = 0x8D82;
-const RGB32I                         = 0x8D83;
-const RGBA16I                        = 0x8D88;
-const RGB16I                         = 0x8D89;
-const RGBA8I                         = 0x8D8E;
-const RGB8I                          = 0x8D8F;
-const RED_INTEGER                    = 0x8D94;
-const GREEN_INTEGER                  = 0x8D95;
-const BLUE_INTEGER                   = 0x8D96;
-const RGB_INTEGER                    = 0x8D98;
-const RGBA_INTEGER                   = 0x8D99;
-const BGR_INTEGER                    = 0x8D9A;
-const BGRA_INTEGER                   = 0x8D9B;
-const SAMPLER_1D_ARRAY               = 0x8DC0;
-const SAMPLER_2D_ARRAY               = 0x8DC1;
-const SAMPLER_1D_ARRAY_SHADOW        = 0x8DC3;
-const SAMPLER_2D_ARRAY_SHADOW        = 0x8DC4;
-const SAMPLER_CUBE_SHADOW            = 0x8DC5;
-const UNSIGNED_INT_VEC2              = 0x8DC6;
-const UNSIGNED_INT_VEC3              = 0x8DC7;
-const UNSIGNED_INT_VEC4              = 0x8DC8;
-const INT_SAMPLER_1D                 = 0x8DC9;
-const INT_SAMPLER_2D                 = 0x8DCA;
-const INT_SAMPLER_3D                 = 0x8DCB;
-const INT_SAMPLER_CUBE               = 0x8DCC;
-const INT_SAMPLER_1D_ARRAY           = 0x8DCE;
-const INT_SAMPLER_2D_ARRAY           = 0x8DCF;
-const UNSIGNED_INT_SAMPLER_1D        = 0x8DD1;
-const UNSIGNED_INT_SAMPLER_2D        = 0x8DD2;
-const UNSIGNED_INT_SAMPLER_3D        = 0x8DD3;
-const UNSIGNED_INT_SAMPLER_CUBE      = 0x8DD4;
-const UNSIGNED_INT_SAMPLER_1D_ARRAY  = 0x8DD6;
-const UNSIGNED_INT_SAMPLER_2D_ARRAY  = 0x8DD7;
-const QUERY_WAIT                     = 0x8E13;
-const QUERY_NO_WAIT                  = 0x8E14;
-const QUERY_BY_REGION_WAIT           = 0x8E15;
-const QUERY_BY_REGION_NO_WAIT        = 0x8E16;
-const BUFFER_ACCESS_FLAGS            = 0x911F;
-const BUFFER_MAP_LENGTH              = 0x9120;
-const BUFFER_MAP_OFFSET              = 0x9121;
-const DEPTH_COMPONENT32F             = 0x8CAC;
-const DEPTH32F_STENCIL8              = 0x8CAD;
-const FLOAT_32_UNSIGNED_INT_24_8_REV = 0x8DAD;
-const INVALID_FRAMEBUFFER_OPERATION  = 0x0506;
-const FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 0x8210;
-const FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 0x8211;
-const FRAMEBUFFER_ATTACHMENT_RED_SIZE = 0x8212;
-const FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 0x8213;
-const FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 0x8214;
-const FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 0x8215;
-const FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 0x8216;
-const FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 0x8217;
-const FRAMEBUFFER_DEFAULT            = 0x8218;
-const FRAMEBUFFER_UNDEFINED          = 0x8219;
-const DEPTH_STENCIL_ATTACHMENT       = 0x821A;
-const MAX_RENDERBUFFER_SIZE          = 0x84E8;
-const DEPTH_STENCIL                  = 0x84F9;
-const UNSIGNED_INT_24_8              = 0x84FA;
-const DEPTH24_STENCIL8               = 0x88F0;
-const TEXTURE_STENCIL_SIZE           = 0x88F1;
-const TEXTURE_RED_TYPE               = 0x8C10;
-const TEXTURE_GREEN_TYPE             = 0x8C11;
-const TEXTURE_BLUE_TYPE              = 0x8C12;
-const TEXTURE_ALPHA_TYPE             = 0x8C13;
-const TEXTURE_DEPTH_TYPE             = 0x8C16;
-const UNSIGNED_NORMALIZED            = 0x8C17;
-const FRAMEBUFFER_BINDING            = 0x8CA6;
-const DRAW_FRAMEBUFFER_BINDING       = 0x8CA6;
-const RENDERBUFFER_BINDING           = 0x8CA7;
-const READ_FRAMEBUFFER               = 0x8CA8;
-const DRAW_FRAMEBUFFER               = 0x8CA9;
-const READ_FRAMEBUFFER_BINDING       = 0x8CAA;
-const RENDERBUFFER_SAMPLES           = 0x8CAB;
-const FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0;
-const FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1;
-const FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2;
-const FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3;
-const FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 0x8CD4;
-const FRAMEBUFFER_COMPLETE           = 0x8CD5;
-const FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6;
-const FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7;
-const FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER = 0x8CDB;
-const FRAMEBUFFER_INCOMPLETE_READ_BUFFER = 0x8CDC;
-const FRAMEBUFFER_UNSUPPORTED        = 0x8CDD;
-const MAX_COLOR_ATTACHMENTS          = 0x8CDF;
-const COLOR_ATTACHMENT0              = 0x8CE0;
-const COLOR_ATTACHMENT1              = 0x8CE1;
-const COLOR_ATTACHMENT2              = 0x8CE2;
-const COLOR_ATTACHMENT3              = 0x8CE3;
-const COLOR_ATTACHMENT4              = 0x8CE4;
-const COLOR_ATTACHMENT5              = 0x8CE5;
-const COLOR_ATTACHMENT6              = 0x8CE6;
-const COLOR_ATTACHMENT7              = 0x8CE7;
-const COLOR_ATTACHMENT8              = 0x8CE8;
-const COLOR_ATTACHMENT9              = 0x8CE9;
-const COLOR_ATTACHMENT10             = 0x8CEA;
-const COLOR_ATTACHMENT11             = 0x8CEB;
-const COLOR_ATTACHMENT12             = 0x8CEC;
-const COLOR_ATTACHMENT13             = 0x8CED;
-const COLOR_ATTACHMENT14             = 0x8CEE;
-const COLOR_ATTACHMENT15             = 0x8CEF;
-const COLOR_ATTACHMENT16             = 0x8CF0;
-const COLOR_ATTACHMENT17             = 0x8CF1;
-const COLOR_ATTACHMENT18             = 0x8CF2;
-const COLOR_ATTACHMENT19             = 0x8CF3;
-const COLOR_ATTACHMENT20             = 0x8CF4;
-const COLOR_ATTACHMENT21             = 0x8CF5;
-const COLOR_ATTACHMENT22             = 0x8CF6;
-const COLOR_ATTACHMENT23             = 0x8CF7;
-const COLOR_ATTACHMENT24             = 0x8CF8;
-const COLOR_ATTACHMENT25             = 0x8CF9;
-const COLOR_ATTACHMENT26             = 0x8CFA;
-const COLOR_ATTACHMENT27             = 0x8CFB;
-const COLOR_ATTACHMENT28             = 0x8CFC;
-const COLOR_ATTACHMENT29             = 0x8CFD;
-const COLOR_ATTACHMENT30             = 0x8CFE;
-const COLOR_ATTACHMENT31             = 0x8CFF;
-const DEPTH_ATTACHMENT               = 0x8D00;
-const STENCIL_ATTACHMENT             = 0x8D20;
-const FRAMEBUFFER                    = 0x8D40;
-const RENDERBUFFER                   = 0x8D41;
-const RENDERBUFFER_WIDTH             = 0x8D42;
-const RENDERBUFFER_HEIGHT            = 0x8D43;
-const RENDERBUFFER_INTERNAL_FORMAT   = 0x8D44;
-const STENCIL_INDEX1                 = 0x8D46;
-const STENCIL_INDEX4                 = 0x8D47;
-const STENCIL_INDEX8                 = 0x8D48;
-const STENCIL_INDEX16                = 0x8D49;
-const RENDERBUFFER_RED_SIZE          = 0x8D50;
-const RENDERBUFFER_GREEN_SIZE        = 0x8D51;
-const RENDERBUFFER_BLUE_SIZE         = 0x8D52;
-const RENDERBUFFER_ALPHA_SIZE        = 0x8D53;
-const RENDERBUFFER_DEPTH_SIZE        = 0x8D54;
-const RENDERBUFFER_STENCIL_SIZE      = 0x8D55;
-const FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 0x8D56;
-const MAX_SAMPLES                    = 0x8D57;
-const FRAMEBUFFER_SRGB               = 0x8DB9;
-const HALF_FLOAT                     = 0x140B;
-const MAP_READ_BIT                   = 0x0001;
-const MAP_WRITE_BIT                  = 0x0002;
-const MAP_INVALIDATE_RANGE_BIT       = 0x0004;
-const MAP_INVALIDATE_BUFFER_BIT      = 0x0008;
-const MAP_FLUSH_EXPLICIT_BIT         = 0x0010;
-const MAP_UNSYNCHRONIZED_BIT         = 0x0020;
-const COMPRESSED_RED_RGTC1           = 0x8DBB;
-const COMPRESSED_SIGNED_RED_RGTC1    = 0x8DBC;
-const COMPRESSED_RG_RGTC2            = 0x8DBD;
-const COMPRESSED_SIGNED_RG_RGTC2     = 0x8DBE;
-const RG                             = 0x8227;
-const RG_INTEGER                     = 0x8228;
-const R8                             = 0x8229;
-const R16                            = 0x822A;
-const RG8                            = 0x822B;
-const RG16                           = 0x822C;
-const R16F                           = 0x822D;
-const R32F                           = 0x822E;
-const RG16F                          = 0x822F;
-const RG32F                          = 0x8230;
-const R8I                            = 0x8231;
-const R8UI                           = 0x8232;
-const R16I                           = 0x8233;
-const R16UI                          = 0x8234;
-const R32I                           = 0x8235;
-const R32UI                          = 0x8236;
-const RG8I                           = 0x8237;
-const RG8UI                          = 0x8238;
-const RG16I                          = 0x8239;
-const RG16UI                         = 0x823A;
-const RG32I                          = 0x823B;
-const RG32UI                         = 0x823C;
-const VERTEX_ARRAY_BINDING           = 0x85B5;
+	SAMPLER_2D_RECT                = 0x8B63;
+	SAMPLER_2D_RECT_SHADOW         = 0x8B64;
+	SAMPLER_BUFFER                 = 0x8DC2;
+	INT_SAMPLER_2D_RECT            = 0x8DCD;
+	INT_SAMPLER_BUFFER             = 0x8DD0;
+	UNSIGNED_INT_SAMPLER_2D_RECT   = 0x8DD5;
+	UNSIGNED_INT_SAMPLER_BUFFER    = 0x8DD8;
+	TEXTURE_BUFFER                 = 0x8C2A;
+	MAX_TEXTURE_BUFFER_SIZE        = 0x8C2B;
+	TEXTURE_BINDING_BUFFER         = 0x8C2C;
+	TEXTURE_BUFFER_DATA_STORE_BINDING = 0x8C2D;
+	TEXTURE_RECTANGLE              = 0x84F5;
+	TEXTURE_BINDING_RECTANGLE      = 0x84F6;
+	PROXY_TEXTURE_RECTANGLE        = 0x84F7;
+	MAX_RECTANGLE_TEXTURE_SIZE     = 0x84F8;
+	R8_SNORM                       = 0x8F94;
+	RG8_SNORM                      = 0x8F95;
+	RGB8_SNORM                     = 0x8F96;
+	RGBA8_SNORM                    = 0x8F97;
+	R16_SNORM                      = 0x8F98;
+	RG16_SNORM                     = 0x8F99;
+	RGB16_SNORM                    = 0x8F9A;
+	RGBA16_SNORM                   = 0x8F9B;
+	SIGNED_NORMALIZED              = 0x8F9C;
+	PRIMITIVE_RESTART              = 0x8F9D;
+	PRIMITIVE_RESTART_INDEX        = 0x8F9E;
+	COPY_READ_BUFFER               = 0x8F36;
+	COPY_WRITE_BUFFER              = 0x8F37;
+	UNIFORM_BUFFER                 = 0x8A11;
+	UNIFORM_BUFFER_BINDING         = 0x8A28;
+	UNIFORM_BUFFER_START           = 0x8A29;
+	UNIFORM_BUFFER_SIZE            = 0x8A2A;
+	MAX_VERTEX_UNIFORM_BLOCKS      = 0x8A2B;
+	MAX_GEOMETRY_UNIFORM_BLOCKS    = 0x8A2C;
+	MAX_FRAGMENT_UNIFORM_BLOCKS    = 0x8A2D;
+	MAX_COMBINED_UNIFORM_BLOCKS    = 0x8A2E;
+	MAX_UNIFORM_BUFFER_BINDINGS    = 0x8A2F;
+	MAX_UNIFORM_BLOCK_SIZE         = 0x8A30;
+	MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 0x8A31;
+	MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS = 0x8A32;
+	MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 0x8A33;
+	UNIFORM_BUFFER_OFFSET_ALIGNMENT = 0x8A34;
+	ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH = 0x8A35;
+	ACTIVE_UNIFORM_BLOCKS          = 0x8A36;
+	UNIFORM_TYPE                   = 0x8A37;
+	UNIFORM_SIZE                   = 0x8A38;
+	UNIFORM_NAME_LENGTH            = 0x8A39;
+	UNIFORM_BLOCK_INDEX            = 0x8A3A;
+	UNIFORM_OFFSET                 = 0x8A3B;
+	UNIFORM_ARRAY_STRIDE           = 0x8A3C;
+	UNIFORM_MATRIX_STRIDE          = 0x8A3D;
+	UNIFORM_IS_ROW_MAJOR           = 0x8A3E;
+	UNIFORM_BLOCK_BINDING          = 0x8A3F;
+	UNIFORM_BLOCK_DATA_SIZE        = 0x8A40;
+	UNIFORM_BLOCK_NAME_LENGTH      = 0x8A41;
+	UNIFORM_BLOCK_ACTIVE_UNIFORMS  = 0x8A42;
+	UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 0x8A43;
+	UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 0x8A44;
+	UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER = 0x8A45;
+	UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 0x8A46;
+	INVALID_INDEX                  = 0xFFFFFFFF;
 
-const SAMPLER_2D_RECT                = 0x8B63;
-const SAMPLER_2D_RECT_SHADOW         = 0x8B64;
-const SAMPLER_BUFFER                 = 0x8DC2;
-const INT_SAMPLER_2D_RECT            = 0x8DCD;
-const INT_SAMPLER_BUFFER             = 0x8DD0;
-const UNSIGNED_INT_SAMPLER_2D_RECT   = 0x8DD5;
-const UNSIGNED_INT_SAMPLER_BUFFER    = 0x8DD8;
-const TEXTURE_BUFFER                 = 0x8C2A;
-const MAX_TEXTURE_BUFFER_SIZE        = 0x8C2B;
-const TEXTURE_BINDING_BUFFER         = 0x8C2C;
-const TEXTURE_BUFFER_DATA_STORE_BINDING = 0x8C2D;
-const TEXTURE_RECTANGLE              = 0x84F5;
-const TEXTURE_BINDING_RECTANGLE      = 0x84F6;
-const PROXY_TEXTURE_RECTANGLE        = 0x84F7;
-const MAX_RECTANGLE_TEXTURE_SIZE     = 0x84F8;
-const R8_SNORM                       = 0x8F94;
-const RG8_SNORM                      = 0x8F95;
-const RGB8_SNORM                     = 0x8F96;
-const RGBA8_SNORM                    = 0x8F97;
-const R16_SNORM                      = 0x8F98;
-const RG16_SNORM                     = 0x8F99;
-const RGB16_SNORM                    = 0x8F9A;
-const RGBA16_SNORM                   = 0x8F9B;
-const SIGNED_NORMALIZED              = 0x8F9C;
-const PRIMITIVE_RESTART              = 0x8F9D;
-const PRIMITIVE_RESTART_INDEX        = 0x8F9E;
-const COPY_READ_BUFFER               = 0x8F36;
-const COPY_WRITE_BUFFER              = 0x8F37;
-const UNIFORM_BUFFER                 = 0x8A11;
-const UNIFORM_BUFFER_BINDING         = 0x8A28;
-const UNIFORM_BUFFER_START           = 0x8A29;
-const UNIFORM_BUFFER_SIZE            = 0x8A2A;
-const MAX_VERTEX_UNIFORM_BLOCKS      = 0x8A2B;
-const MAX_GEOMETRY_UNIFORM_BLOCKS    = 0x8A2C;
-const MAX_FRAGMENT_UNIFORM_BLOCKS    = 0x8A2D;
-const MAX_COMBINED_UNIFORM_BLOCKS    = 0x8A2E;
-const MAX_UNIFORM_BUFFER_BINDINGS    = 0x8A2F;
-const MAX_UNIFORM_BLOCK_SIZE         = 0x8A30;
-const MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 0x8A31;
-const MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS = 0x8A32;
-const MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 0x8A33;
-const UNIFORM_BUFFER_OFFSET_ALIGNMENT = 0x8A34;
-const ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH = 0x8A35;
-const ACTIVE_UNIFORM_BLOCKS          = 0x8A36;
-const UNIFORM_TYPE                   = 0x8A37;
-const UNIFORM_SIZE                   = 0x8A38;
-const UNIFORM_NAME_LENGTH            = 0x8A39;
-const UNIFORM_BLOCK_INDEX            = 0x8A3A;
-const UNIFORM_OFFSET                 = 0x8A3B;
-const UNIFORM_ARRAY_STRIDE           = 0x8A3C;
-const UNIFORM_MATRIX_STRIDE          = 0x8A3D;
-const UNIFORM_IS_ROW_MAJOR           = 0x8A3E;
-const UNIFORM_BLOCK_BINDING          = 0x8A3F;
-const UNIFORM_BLOCK_DATA_SIZE        = 0x8A40;
-const UNIFORM_BLOCK_NAME_LENGTH      = 0x8A41;
-const UNIFORM_BLOCK_ACTIVE_UNIFORMS  = 0x8A42;
-const UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 0x8A43;
-const UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 0x8A44;
-const UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER = 0x8A45;
-const UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 0x8A46;
-const INVALID_INDEX                  = 0xFFFFFFFF;
+	CONTEXT_CORE_PROFILE_BIT       = 0x00000001;
+	CONTEXT_COMPATIBILITY_PROFILE_BIT = 0x00000002;
+	LINES_ADJACENCY                = 0x000A;
+	LINE_STRIP_ADJACENCY           = 0x000B;
+	TRIANGLES_ADJACENCY            = 0x000C;
+	TRIANGLE_STRIP_ADJACENCY       = 0x000D;
+	PROGRAM_POINT_SIZE             = 0x8642;
+	MAX_GEOMETRY_TEXTURE_IMAGE_UNITS = 0x8C29;
+	FRAMEBUFFER_ATTACHMENT_LAYERED = 0x8DA7;
+	FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS = 0x8DA8;
+	GEOMETRY_SHADER                = 0x8DD9;
+	GEOMETRY_VERTICES_OUT          = 0x8916;
+	GEOMETRY_INPUT_TYPE            = 0x8917;
+	GEOMETRY_OUTPUT_TYPE           = 0x8918;
+	MAX_GEOMETRY_UNIFORM_COMPONENTS = 0x8DDF;
+	MAX_GEOMETRY_OUTPUT_VERTICES   = 0x8DE0;
+	MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS = 0x8DE1;
+	MAX_VERTEX_OUTPUT_COMPONENTS   = 0x9122;
+	MAX_GEOMETRY_INPUT_COMPONENTS  = 0x9123;
+	MAX_GEOMETRY_OUTPUT_COMPONENTS = 0x9124;
+	MAX_FRAGMENT_INPUT_COMPONENTS  = 0x9125;
+	CONTEXT_PROFILE_MASK           = 0x9126;
+	DEPTH_CLAMP                    = 0x864F;
+	QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION = 0x8E4C;
+	FIRST_VERTEX_CONVENTION        = 0x8E4D;
+	LAST_VERTEX_CONVENTION         = 0x8E4E;
+	PROVOKING_VERTEX               = 0x8E4F;
+	TEXTURE_CUBE_MAP_SEAMLESS      = 0x884F;
+	MAX_SERVER_WAIT_TIMEOUT        = 0x9111;
+	OBJECT_TYPE                    = 0x9112;
+	SYNC_CONDITION                 = 0x9113;
+	SYNC_STATUS                    = 0x9114;
+	SYNC_FLAGS                     = 0x9115;
+	SYNC_FENCE                     = 0x9116;
+	SYNC_GPU_COMMANDS_COMPLETE     = 0x9117;
+	UNSIGNALED                     = 0x9118;
+	SIGNALED                       = 0x9119;
+	ALREADY_SIGNALED               = 0x911A;
+	TIMEOUT_EXPIRED                = 0x911B;
+	CONDITION_SATISFIED            = 0x911C;
+	WAIT_FAILED                    = 0x911D;
+	TIMEOUT_IGNORED                = 0xFFFFFFFFFFFFFFFF;
+	SYNC_FLUSH_COMMANDS_BIT        = 0x00000001;
+	SAMPLE_POSITION                = 0x8E50;
+	SAMPLE_MASK                    = 0x8E51;
+	SAMPLE_MASK_VALUE              = 0x8E52;
+	MAX_SAMPLE_MASK_WORDS          = 0x8E59;
+	TEXTURE_2D_MULTISAMPLE         = 0x9100;
+	PROXY_TEXTURE_2D_MULTISAMPLE   = 0x9101;
+	TEXTURE_2D_MULTISAMPLE_ARRAY   = 0x9102;
+	PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9103;
+	TEXTURE_BINDING_2D_MULTISAMPLE = 0x9104;
+	TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY = 0x9105;
+	TEXTURE_SAMPLES                = 0x9106;
+	TEXTURE_FIXED_SAMPLE_LOCATIONS = 0x9107;
+	SAMPLER_2D_MULTISAMPLE         = 0x9108;
+	INT_SAMPLER_2D_MULTISAMPLE     = 0x9109;
+	UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE = 0x910A;
+	SAMPLER_2D_MULTISAMPLE_ARRAY   = 0x910B;
+	INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910C;
+	UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910D;
+	MAX_COLOR_TEXTURE_SAMPLES      = 0x910E;
+	MAX_DEPTH_TEXTURE_SAMPLES      = 0x910F;
+	MAX_INTEGER_SAMPLES            = 0x9110;
 
-const CONTEXT_CORE_PROFILE_BIT       = 0x00000001;
-const CONTEXT_COMPATIBILITY_PROFILE_BIT = 0x00000002;
-const LINES_ADJACENCY                = 0x000A;
-const LINE_STRIP_ADJACENCY           = 0x000B;
-const TRIANGLES_ADJACENCY            = 0x000C;
-const TRIANGLE_STRIP_ADJACENCY       = 0x000D;
-const PROGRAM_POINT_SIZE             = 0x8642;
-const MAX_GEOMETRY_TEXTURE_IMAGE_UNITS = 0x8C29;
-const FRAMEBUFFER_ATTACHMENT_LAYERED = 0x8DA7;
-const FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS = 0x8DA8;
-const GEOMETRY_SHADER                = 0x8DD9;
-const GEOMETRY_VERTICES_OUT          = 0x8916;
-const GEOMETRY_INPUT_TYPE            = 0x8917;
-const GEOMETRY_OUTPUT_TYPE           = 0x8918;
-const MAX_GEOMETRY_UNIFORM_COMPONENTS = 0x8DDF;
-const MAX_GEOMETRY_OUTPUT_VERTICES   = 0x8DE0;
-const MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS = 0x8DE1;
-const MAX_VERTEX_OUTPUT_COMPONENTS   = 0x9122;
-const MAX_GEOMETRY_INPUT_COMPONENTS  = 0x9123;
-const MAX_GEOMETRY_OUTPUT_COMPONENTS = 0x9124;
-const MAX_FRAGMENT_INPUT_COMPONENTS  = 0x9125;
-const CONTEXT_PROFILE_MASK           = 0x9126;
-const DEPTH_CLAMP                    = 0x864F;
-const QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION = 0x8E4C;
-const FIRST_VERTEX_CONVENTION        = 0x8E4D;
-const LAST_VERTEX_CONVENTION         = 0x8E4E;
-const PROVOKING_VERTEX               = 0x8E4F;
-const TEXTURE_CUBE_MAP_SEAMLESS      = 0x884F;
-const MAX_SERVER_WAIT_TIMEOUT        = 0x9111;
-const OBJECT_TYPE                    = 0x9112;
-const SYNC_CONDITION                 = 0x9113;
-const SYNC_STATUS                    = 0x9114;
-const SYNC_FLAGS                     = 0x9115;
-const SYNC_FENCE                     = 0x9116;
-const SYNC_GPU_COMMANDS_COMPLETE     = 0x9117;
-const UNSIGNALED                     = 0x9118;
-const SIGNALED                       = 0x9119;
-const ALREADY_SIGNALED               = 0x911A;
-const TIMEOUT_EXPIRED                = 0x911B;
-const CONDITION_SATISFIED            = 0x911C;
-const WAIT_FAILED                    = 0x911D;
-const TIMEOUT_IGNORED                = 0xFFFFFFFFFFFFFFFF;
-const SYNC_FLUSH_COMMANDS_BIT        = 0x00000001;
-const SAMPLE_POSITION                = 0x8E50;
-const SAMPLE_MASK                    = 0x8E51;
-const SAMPLE_MASK_VALUE              = 0x8E52;
-const MAX_SAMPLE_MASK_WORDS          = 0x8E59;
-const TEXTURE_2D_MULTISAMPLE         = 0x9100;
-const PROXY_TEXTURE_2D_MULTISAMPLE   = 0x9101;
-const TEXTURE_2D_MULTISAMPLE_ARRAY   = 0x9102;
-const PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9103;
-const TEXTURE_BINDING_2D_MULTISAMPLE = 0x9104;
-const TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY = 0x9105;
-const TEXTURE_SAMPLES                = 0x9106;
-const TEXTURE_FIXED_SAMPLE_LOCATIONS = 0x9107;
-const SAMPLER_2D_MULTISAMPLE         = 0x9108;
-const INT_SAMPLER_2D_MULTISAMPLE     = 0x9109;
-const UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE = 0x910A;
-const SAMPLER_2D_MULTISAMPLE_ARRAY   = 0x910B;
-const INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910C;
-const UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910D;
-const MAX_COLOR_TEXTURE_SAMPLES      = 0x910E;
-const MAX_DEPTH_TEXTURE_SAMPLES      = 0x910F;
-const MAX_INTEGER_SAMPLES            = 0x9110;
+	VERTEX_ATTRIB_ARRAY_DIVISOR    = 0x88FE;
+	SRC1_COLOR                     = 0x88F9;
+	ONE_MINUS_SRC1_COLOR           = 0x88FA;
+	ONE_MINUS_SRC1_ALPHA           = 0x88FB;
+	MAX_DUAL_SOURCE_DRAW_BUFFERS   = 0x88FC;
+	ANY_SAMPLES_PASSED             = 0x8C2F;
+	SAMPLER_BINDING                = 0x8919;
+	RGB10_A2UI                     = 0x906F;
+	TEXTURE_SWIZZLE_R              = 0x8E42;
+	TEXTURE_SWIZZLE_G              = 0x8E43;
+	TEXTURE_SWIZZLE_B              = 0x8E44;
+	TEXTURE_SWIZZLE_A              = 0x8E45;
+	TEXTURE_SWIZZLE_RGBA           = 0x8E46;
+	TIME_ELAPSED                   = 0x88BF;
+	TIMESTAMP                      = 0x8E28;
+	INT_2_10_10_10_REV             = 0x8D9F;
 
-const VERTEX_ATTRIB_ARRAY_DIVISOR    = 0x88FE;
-const SRC1_COLOR                     = 0x88F9;
-const ONE_MINUS_SRC1_COLOR           = 0x88FA;
-const ONE_MINUS_SRC1_ALPHA           = 0x88FB;
-const MAX_DUAL_SOURCE_DRAW_BUFFERS   = 0x88FC;
-const ANY_SAMPLES_PASSED             = 0x8C2F;
-const SAMPLER_BINDING                = 0x8919;
-const RGB10_A2UI                     = 0x906F;
-const TEXTURE_SWIZZLE_R              = 0x8E42;
-const TEXTURE_SWIZZLE_G              = 0x8E43;
-const TEXTURE_SWIZZLE_B              = 0x8E44;
-const TEXTURE_SWIZZLE_A              = 0x8E45;
-const TEXTURE_SWIZZLE_RGBA           = 0x8E46;
-const TIME_ELAPSED                   = 0x88BF;
-const TIMESTAMP                      = 0x8E28;
-const INT_2_10_10_10_REV             = 0x8D9F;
+	SAMPLE_SHADING                 = 0x8C36;
+	MIN_SAMPLE_SHADING_VALUE       = 0x8C37;
+	MIN_PROGRAM_TEXTURE_GATHER_OFFSET = 0x8E5E;
+	MAX_PROGRAM_TEXTURE_GATHER_OFFSET = 0x8E5F;
+	TEXTURE_CUBE_MAP_ARRAY         = 0x9009;
+	TEXTURE_BINDING_CUBE_MAP_ARRAY = 0x900A;
+	PROXY_TEXTURE_CUBE_MAP_ARRAY   = 0x900B;
+	SAMPLER_CUBE_MAP_ARRAY         = 0x900C;
+	SAMPLER_CUBE_MAP_ARRAY_SHADOW  = 0x900D;
+	INT_SAMPLER_CUBE_MAP_ARRAY     = 0x900E;
+	UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY = 0x900F;
+	DRAW_INDIRECT_BUFFER           = 0x8F3F;
+	DRAW_INDIRECT_BUFFER_BINDING   = 0x8F43;
+	GEOMETRY_SHADER_INVOCATIONS    = 0x887F;
+	MAX_GEOMETRY_SHADER_INVOCATIONS = 0x8E5A;
+	MIN_FRAGMENT_INTERPOLATION_OFFSET = 0x8E5B;
+	MAX_FRAGMENT_INTERPOLATION_OFFSET = 0x8E5C;
+	FRAGMENT_INTERPOLATION_OFFSET_BITS = 0x8E5D;
+	MAX_VERTEX_STREAMS             = 0x8E71;
+	DOUBLE_VEC2                    = 0x8FFC;
+	DOUBLE_VEC3                    = 0x8FFD;
+	DOUBLE_VEC4                    = 0x8FFE;
+	DOUBLE_MAT2                    = 0x8F46;
+	DOUBLE_MAT3                    = 0x8F47;
+	DOUBLE_MAT4                    = 0x8F48;
+	DOUBLE_MAT2x3                  = 0x8F49;
+	DOUBLE_MAT2x4                  = 0x8F4A;
+	DOUBLE_MAT3x2                  = 0x8F4B;
+	DOUBLE_MAT3x4                  = 0x8F4C;
+	DOUBLE_MAT4x2                  = 0x8F4D;
+	DOUBLE_MAT4x3                  = 0x8F4E;
+	ACTIVE_SUBROUTINES             = 0x8DE5;
+	ACTIVE_SUBROUTINE_UNIFORMS     = 0x8DE6;
+	ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS = 0x8E47;
+	ACTIVE_SUBROUTINE_MAX_LENGTH   = 0x8E48;
+	ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH = 0x8E49;
+	MAX_SUBROUTINES                = 0x8DE7;
+	MAX_SUBROUTINE_UNIFORM_LOCATIONS = 0x8DE8;
+	NUM_COMPATIBLE_SUBROUTINES     = 0x8E4A;
+	COMPATIBLE_SUBROUTINES         = 0x8E4B;
+	PATCHES                        = 0x000E;
+	PATCH_VERTICES                 = 0x8E72;
+	PATCH_DEFAULT_INNER_LEVEL      = 0x8E73;
+	PATCH_DEFAULT_OUTER_LEVEL      = 0x8E74;
+	TESS_CONTROL_OUTPUT_VERTICES   = 0x8E75;
+	TESS_GEN_MODE                  = 0x8E76;
+	TESS_GEN_SPACING               = 0x8E77;
+	TESS_GEN_VERTEX_ORDER          = 0x8E78;
+	TESS_GEN_POINT_MODE            = 0x8E79;
+	ISOLINES                       = 0x8E7A;
+	FRACTIONAL_ODD                 = 0x8E7B;
+	FRACTIONAL_EVEN                = 0x8E7C;
+	MAX_PATCH_VERTICES             = 0x8E7D;
+	MAX_TESS_GEN_LEVEL             = 0x8E7E;
+	MAX_TESS_CONTROL_UNIFORM_COMPONENTS = 0x8E7F;
+	MAX_TESS_EVALUATION_UNIFORM_COMPONENTS = 0x8E80;
+	MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS = 0x8E81;
+	MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS = 0x8E82;
+	MAX_TESS_CONTROL_OUTPUT_COMPONENTS = 0x8E83;
+	MAX_TESS_PATCH_COMPONENTS      = 0x8E84;
+	MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS = 0x8E85;
+	MAX_TESS_EVALUATION_OUTPUT_COMPONENTS = 0x8E86;
+	MAX_TESS_CONTROL_UNIFORM_BLOCKS = 0x8E89;
+	MAX_TESS_EVALUATION_UNIFORM_BLOCKS = 0x8E8A;
+	MAX_TESS_CONTROL_INPUT_COMPONENTS = 0x886C;
+	MAX_TESS_EVALUATION_INPUT_COMPONENTS = 0x886D;
+	MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS = 0x8E1E;
+	MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS = 0x8E1F;
+	UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER = 0x84F0;
+	UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x84F1;
+	TESS_EVALUATION_SHADER         = 0x8E87;
+	TESS_CONTROL_SHADER            = 0x8E88;
+	TRANSFORM_FEEDBACK             = 0x8E22;
+	TRANSFORM_FEEDBACK_BUFFER_PAUSED = 0x8E23;
+	TRANSFORM_FEEDBACK_BUFFER_ACTIVE = 0x8E24;
+	TRANSFORM_FEEDBACK_BINDING     = 0x8E25;
+	MAX_TRANSFORM_FEEDBACK_BUFFERS = 0x8E70;
 
-const SAMPLE_SHADING                 = 0x8C36;
-const MIN_SAMPLE_SHADING_VALUE       = 0x8C37;
-const MIN_PROGRAM_TEXTURE_GATHER_OFFSET = 0x8E5E;
-const MAX_PROGRAM_TEXTURE_GATHER_OFFSET = 0x8E5F;
-const TEXTURE_CUBE_MAP_ARRAY         = 0x9009;
-const TEXTURE_BINDING_CUBE_MAP_ARRAY = 0x900A;
-const PROXY_TEXTURE_CUBE_MAP_ARRAY   = 0x900B;
-const SAMPLER_CUBE_MAP_ARRAY         = 0x900C;
-const SAMPLER_CUBE_MAP_ARRAY_SHADOW  = 0x900D;
-const INT_SAMPLER_CUBE_MAP_ARRAY     = 0x900E;
-const UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY = 0x900F;
-const DRAW_INDIRECT_BUFFER           = 0x8F3F;
-const DRAW_INDIRECT_BUFFER_BINDING   = 0x8F43;
-const GEOMETRY_SHADER_INVOCATIONS    = 0x887F;
-const MAX_GEOMETRY_SHADER_INVOCATIONS = 0x8E5A;
-const MIN_FRAGMENT_INTERPOLATION_OFFSET = 0x8E5B;
-const MAX_FRAGMENT_INTERPOLATION_OFFSET = 0x8E5C;
-const FRAGMENT_INTERPOLATION_OFFSET_BITS = 0x8E5D;
-const MAX_VERTEX_STREAMS             = 0x8E71;
-const DOUBLE_VEC2                    = 0x8FFC;
-const DOUBLE_VEC3                    = 0x8FFD;
-const DOUBLE_VEC4                    = 0x8FFE;
-const DOUBLE_MAT2                    = 0x8F46;
-const DOUBLE_MAT3                    = 0x8F47;
-const DOUBLE_MAT4                    = 0x8F48;
-const DOUBLE_MAT2x3                  = 0x8F49;
-const DOUBLE_MAT2x4                  = 0x8F4A;
-const DOUBLE_MAT3x2                  = 0x8F4B;
-const DOUBLE_MAT3x4                  = 0x8F4C;
-const DOUBLE_MAT4x2                  = 0x8F4D;
-const DOUBLE_MAT4x3                  = 0x8F4E;
-const ACTIVE_SUBROUTINES             = 0x8DE5;
-const ACTIVE_SUBROUTINE_UNIFORMS     = 0x8DE6;
-const ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS = 0x8E47;
-const ACTIVE_SUBROUTINE_MAX_LENGTH   = 0x8E48;
-const ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH = 0x8E49;
-const MAX_SUBROUTINES                = 0x8DE7;
-const MAX_SUBROUTINE_UNIFORM_LOCATIONS = 0x8DE8;
-const NUM_COMPATIBLE_SUBROUTINES     = 0x8E4A;
-const COMPATIBLE_SUBROUTINES         = 0x8E4B;
-const PATCHES                        = 0x000E;
-const PATCH_VERTICES                 = 0x8E72;
-const PATCH_DEFAULT_INNER_LEVEL      = 0x8E73;
-const PATCH_DEFAULT_OUTER_LEVEL      = 0x8E74;
-const TESS_CONTROL_OUTPUT_VERTICES   = 0x8E75;
-const TESS_GEN_MODE                  = 0x8E76;
-const TESS_GEN_SPACING               = 0x8E77;
-const TESS_GEN_VERTEX_ORDER          = 0x8E78;
-const TESS_GEN_POINT_MODE            = 0x8E79;
-const ISOLINES                       = 0x8E7A;
-const FRACTIONAL_ODD                 = 0x8E7B;
-const FRACTIONAL_EVEN                = 0x8E7C;
-const MAX_PATCH_VERTICES             = 0x8E7D;
-const MAX_TESS_GEN_LEVEL             = 0x8E7E;
-const MAX_TESS_CONTROL_UNIFORM_COMPONENTS = 0x8E7F;
-const MAX_TESS_EVALUATION_UNIFORM_COMPONENTS = 0x8E80;
-const MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS = 0x8E81;
-const MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS = 0x8E82;
-const MAX_TESS_CONTROL_OUTPUT_COMPONENTS = 0x8E83;
-const MAX_TESS_PATCH_COMPONENTS      = 0x8E84;
-const MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS = 0x8E85;
-const MAX_TESS_EVALUATION_OUTPUT_COMPONENTS = 0x8E86;
-const MAX_TESS_CONTROL_UNIFORM_BLOCKS = 0x8E89;
-const MAX_TESS_EVALUATION_UNIFORM_BLOCKS = 0x8E8A;
-const MAX_TESS_CONTROL_INPUT_COMPONENTS = 0x886C;
-const MAX_TESS_EVALUATION_INPUT_COMPONENTS = 0x886D;
-const MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS = 0x8E1E;
-const MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS = 0x8E1F;
-const UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER = 0x84F0;
-const UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x84F1;
-const TESS_EVALUATION_SHADER         = 0x8E87;
-const TESS_CONTROL_SHADER            = 0x8E88;
-const TRANSFORM_FEEDBACK             = 0x8E22;
-const TRANSFORM_FEEDBACK_BUFFER_PAUSED = 0x8E23;
-const TRANSFORM_FEEDBACK_BUFFER_ACTIVE = 0x8E24;
-const TRANSFORM_FEEDBACK_BINDING     = 0x8E25;
-const MAX_TRANSFORM_FEEDBACK_BUFFERS = 0x8E70;
+	FIXED                          = 0x140C;
+	IMPLEMENTATION_COLOR_READ_TYPE = 0x8B9A;
+	IMPLEMENTATION_COLOR_READ_FORMAT = 0x8B9B;
+	LOW_FLOAT                      = 0x8DF0;
+	MEDIUM_FLOAT                   = 0x8DF1;
+	HIGH_FLOAT                     = 0x8DF2;
+	LOW_INT                        = 0x8DF3;
+	MEDIUM_INT                     = 0x8DF4;
+	HIGH_INT                       = 0x8DF5;
+	SHADER_COMPILER                = 0x8DFA;
+	SHADER_BINARY_FORMATS          = 0x8DF8;
+	NUM_SHADER_BINARY_FORMATS      = 0x8DF9;
+	MAX_VERTEX_UNIFORM_VECTORS     = 0x8DFB;
+	MAX_VARYING_VECTORS            = 0x8DFC;
+	MAX_FRAGMENT_UNIFORM_VECTORS   = 0x8DFD;
+	RGB565                         = 0x8D62;
+	PROGRAM_BINARY_RETRIEVABLE_HINT = 0x8257;
+	PROGRAM_BINARY_LENGTH          = 0x8741;
+	NUM_PROGRAM_BINARY_FORMATS     = 0x87FE;
+	PROGRAM_BINARY_FORMATS         = 0x87FF;
+	VERTEX_SHADER_BIT              = 0x00000001;
+	FRAGMENT_SHADER_BIT            = 0x00000002;
+	GEOMETRY_SHADER_BIT            = 0x00000004;
+	TESS_CONTROL_SHADER_BIT        = 0x00000008;
+	TESS_EVALUATION_SHADER_BIT     = 0x00000010;
+	ALL_SHADER_BITS                = 0xFFFFFFFF;
+	PROGRAM_SEPARABLE              = 0x8258;
+	ACTIVE_PROGRAM                 = 0x8259;
+	PROGRAM_PIPELINE_BINDING       = 0x825A;
+	MAX_VIEWPORTS                  = 0x825B;
+	VIEWPORT_SUBPIXEL_BITS         = 0x825C;
+	VIEWPORT_BOUNDS_RANGE          = 0x825D;
+	LAYER_PROVOKING_VERTEX         = 0x825E;
+	VIEWPORT_INDEX_PROVOKING_VERTEX = 0x825F;
+	UNDEFINED_VERTEX               = 0x8260;
 
-const FIXED                          = 0x140C;
-const IMPLEMENTATION_COLOR_READ_TYPE = 0x8B9A;
-const IMPLEMENTATION_COLOR_READ_FORMAT = 0x8B9B;
-const LOW_FLOAT                      = 0x8DF0;
-const MEDIUM_FLOAT                   = 0x8DF1;
-const HIGH_FLOAT                     = 0x8DF2;
-const LOW_INT                        = 0x8DF3;
-const MEDIUM_INT                     = 0x8DF4;
-const HIGH_INT                       = 0x8DF5;
-const SHADER_COMPILER                = 0x8DFA;
-const SHADER_BINARY_FORMATS          = 0x8DF8;
-const NUM_SHADER_BINARY_FORMATS      = 0x8DF9;
-const MAX_VERTEX_UNIFORM_VECTORS     = 0x8DFB;
-const MAX_VARYING_VECTORS            = 0x8DFC;
-const MAX_FRAGMENT_UNIFORM_VECTORS   = 0x8DFD;
-const RGB565                         = 0x8D62;
-const PROGRAM_BINARY_RETRIEVABLE_HINT = 0x8257;
-const PROGRAM_BINARY_LENGTH          = 0x8741;
-const NUM_PROGRAM_BINARY_FORMATS     = 0x87FE;
-const PROGRAM_BINARY_FORMATS         = 0x87FF;
-const VERTEX_SHADER_BIT              = 0x00000001;
-const FRAGMENT_SHADER_BIT            = 0x00000002;
-const GEOMETRY_SHADER_BIT            = 0x00000004;
-const TESS_CONTROL_SHADER_BIT        = 0x00000008;
-const TESS_EVALUATION_SHADER_BIT     = 0x00000010;
-const ALL_SHADER_BITS                = 0xFFFFFFFF;
-const PROGRAM_SEPARABLE              = 0x8258;
-const ACTIVE_PROGRAM                 = 0x8259;
-const PROGRAM_PIPELINE_BINDING       = 0x825A;
-const MAX_VIEWPORTS                  = 0x825B;
-const VIEWPORT_SUBPIXEL_BITS         = 0x825C;
-const VIEWPORT_BOUNDS_RANGE          = 0x825D;
-const LAYER_PROVOKING_VERTEX         = 0x825E;
-const VIEWPORT_INDEX_PROVOKING_VERTEX = 0x825F;
-const UNDEFINED_VERTEX               = 0x8260;
+	COPY_READ_BUFFER_BINDING       = 0x8F36;
+	COPY_WRITE_BUFFER_BINDING      = 0x8F37;
+	TRANSFORM_FEEDBACK_ACTIVE      = 0x8E24;
+	TRANSFORM_FEEDBACK_PAUSED      = 0x8E23;
+	UNPACK_COMPRESSED_BLOCK_WIDTH  = 0x9127;
+	UNPACK_COMPRESSED_BLOCK_HEIGHT = 0x9128;
+	UNPACK_COMPRESSED_BLOCK_DEPTH  = 0x9129;
+	UNPACK_COMPRESSED_BLOCK_SIZE   = 0x912A;
+	PACK_COMPRESSED_BLOCK_WIDTH    = 0x912B;
+	PACK_COMPRESSED_BLOCK_HEIGHT   = 0x912C;
+	PACK_COMPRESSED_BLOCK_DEPTH    = 0x912D;
+	PACK_COMPRESSED_BLOCK_SIZE     = 0x912E;
+	NUM_SAMPLE_COUNTS              = 0x9380;
+	MIN_MAP_BUFFER_ALIGNMENT       = 0x90BC;
+	ATOMIC_COUNTER_BUFFER          = 0x92C0;
+	ATOMIC_COUNTER_BUFFER_BINDING  = 0x92C1;
+	ATOMIC_COUNTER_BUFFER_START    = 0x92C2;
+	ATOMIC_COUNTER_BUFFER_SIZE     = 0x92C3;
+	ATOMIC_COUNTER_BUFFER_DATA_SIZE = 0x92C4;
+	ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS = 0x92C5;
+	ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES = 0x92C6;
+	ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER = 0x92C7;
+	ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER = 0x92C8;
+	ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x92C9;
+	ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER = 0x92CA;
+	ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER = 0x92CB;
+	MAX_VERTEX_ATOMIC_COUNTER_BUFFERS = 0x92CC;
+	MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS = 0x92CD;
+	MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS = 0x92CE;
+	MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS = 0x92CF;
+	MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS = 0x92D0;
+	MAX_COMBINED_ATOMIC_COUNTER_BUFFERS = 0x92D1;
+	MAX_VERTEX_ATOMIC_COUNTERS     = 0x92D2;
+	MAX_TESS_CONTROL_ATOMIC_COUNTERS = 0x92D3;
+	MAX_TESS_EVALUATION_ATOMIC_COUNTERS = 0x92D4;
+	MAX_GEOMETRY_ATOMIC_COUNTERS   = 0x92D5;
+	MAX_FRAGMENT_ATOMIC_COUNTERS   = 0x92D6;
+	MAX_COMBINED_ATOMIC_COUNTERS   = 0x92D7;
+	MAX_ATOMIC_COUNTER_BUFFER_SIZE = 0x92D8;
+	MAX_ATOMIC_COUNTER_BUFFER_BINDINGS = 0x92DC;
+	ACTIVE_ATOMIC_COUNTER_BUFFERS  = 0x92D9;
+	UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX = 0x92DA;
+	UNSIGNED_INT_ATOMIC_COUNTER    = 0x92DB;
+	VERTEX_ATTRIB_ARRAY_BARRIER_BIT = 0x00000001;
+	ELEMENT_ARRAY_BARRIER_BIT      = 0x00000002;
+	UNIFORM_BARRIER_BIT            = 0x00000004;
+	TEXTURE_FETCH_BARRIER_BIT      = 0x00000008;
+	SHADER_IMAGE_ACCESS_BARRIER_BIT = 0x00000020;
+	COMMAND_BARRIER_BIT            = 0x00000040;
+	PIXEL_BUFFER_BARRIER_BIT       = 0x00000080;
+	TEXTURE_UPDATE_BARRIER_BIT     = 0x00000100;
+	BUFFER_UPDATE_BARRIER_BIT      = 0x00000200;
+	FRAMEBUFFER_BARRIER_BIT        = 0x00000400;
+	TRANSFORM_FEEDBACK_BARRIER_BIT = 0x00000800;
+	ATOMIC_COUNTER_BARRIER_BIT     = 0x00001000;
+	ALL_BARRIER_BITS               = 0xFFFFFFFF;
+	MAX_IMAGE_UNITS                = 0x8F38;
+	MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS = 0x8F39;
+	IMAGE_BINDING_NAME             = 0x8F3A;
+	IMAGE_BINDING_LEVEL            = 0x8F3B;
+	IMAGE_BINDING_LAYERED          = 0x8F3C;
+	IMAGE_BINDING_LAYER            = 0x8F3D;
+	IMAGE_BINDING_ACCESS           = 0x8F3E;
+	IMAGE_1D                       = 0x904C;
+	IMAGE_2D                       = 0x904D;
+	IMAGE_3D                       = 0x904E;
+	IMAGE_2D_RECT                  = 0x904F;
+	IMAGE_CUBE                     = 0x9050;
+	IMAGE_BUFFER                   = 0x9051;
+	IMAGE_1D_ARRAY                 = 0x9052;
+	IMAGE_2D_ARRAY                 = 0x9053;
+	IMAGE_CUBE_MAP_ARRAY           = 0x9054;
+	IMAGE_2D_MULTISAMPLE           = 0x9055;
+	IMAGE_2D_MULTISAMPLE_ARRAY     = 0x9056;
+	INT_IMAGE_1D                   = 0x9057;
+	INT_IMAGE_2D                   = 0x9058;
+	INT_IMAGE_3D                   = 0x9059;
+	INT_IMAGE_2D_RECT              = 0x905A;
+	INT_IMAGE_CUBE                 = 0x905B;
+	INT_IMAGE_BUFFER               = 0x905C;
+	INT_IMAGE_1D_ARRAY             = 0x905D;
+	INT_IMAGE_2D_ARRAY             = 0x905E;
+	INT_IMAGE_CUBE_MAP_ARRAY       = 0x905F;
+	INT_IMAGE_2D_MULTISAMPLE       = 0x9060;
+	INT_IMAGE_2D_MULTISAMPLE_ARRAY = 0x9061;
+	UNSIGNED_INT_IMAGE_1D          = 0x9062;
+	UNSIGNED_INT_IMAGE_2D          = 0x9063;
+	UNSIGNED_INT_IMAGE_3D          = 0x9064;
+	UNSIGNED_INT_IMAGE_2D_RECT     = 0x9065;
+	UNSIGNED_INT_IMAGE_CUBE        = 0x9066;
+	UNSIGNED_INT_IMAGE_BUFFER      = 0x9067;
+	UNSIGNED_INT_IMAGE_1D_ARRAY    = 0x9068;
+	UNSIGNED_INT_IMAGE_2D_ARRAY    = 0x9069;
+	UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY = 0x906A;
+	UNSIGNED_INT_IMAGE_2D_MULTISAMPLE = 0x906B;
+	UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY = 0x906C;
+	MAX_IMAGE_SAMPLES              = 0x906D;
+	IMAGE_BINDING_FORMAT           = 0x906E;
+	IMAGE_FORMAT_COMPATIBILITY_TYPE = 0x90C7;
+	IMAGE_FORMAT_COMPATIBILITY_BY_SIZE = 0x90C8;
+	IMAGE_FORMAT_COMPATIBILITY_BY_CLASS = 0x90C9;
+	MAX_VERTEX_IMAGE_UNIFORMS      = 0x90CA;
+	MAX_TESS_CONTROL_IMAGE_UNIFORMS = 0x90CB;
+	MAX_TESS_EVALUATION_IMAGE_UNIFORMS = 0x90CC;
+	MAX_GEOMETRY_IMAGE_UNIFORMS    = 0x90CD;
+	MAX_FRAGMENT_IMAGE_UNIFORMS    = 0x90CE;
+	MAX_COMBINED_IMAGE_UNIFORMS    = 0x90CF;
+	COMPRESSED_RGBA_BPTC_UNORM     = 0x8E8C;
+	COMPRESSED_SRGB_ALPHA_BPTC_UNORM = 0x8E8D;
+	COMPRESSED_RGB_BPTC_SIGNED_FLOAT = 0x8E8E;
+	COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT = 0x8E8F;
+	TEXTURE_IMMUTABLE_FORMAT       = 0x912F;
 
-const COPY_READ_BUFFER_BINDING       = 0x8F36;
-const COPY_WRITE_BUFFER_BINDING      = 0x8F37;
-const TRANSFORM_FEEDBACK_ACTIVE      = 0x8E24;
-const TRANSFORM_FEEDBACK_PAUSED      = 0x8E23;
-const UNPACK_COMPRESSED_BLOCK_WIDTH  = 0x9127;
-const UNPACK_COMPRESSED_BLOCK_HEIGHT = 0x9128;
-const UNPACK_COMPRESSED_BLOCK_DEPTH  = 0x9129;
-const UNPACK_COMPRESSED_BLOCK_SIZE   = 0x912A;
-const PACK_COMPRESSED_BLOCK_WIDTH    = 0x912B;
-const PACK_COMPRESSED_BLOCK_HEIGHT   = 0x912C;
-const PACK_COMPRESSED_BLOCK_DEPTH    = 0x912D;
-const PACK_COMPRESSED_BLOCK_SIZE     = 0x912E;
-const NUM_SAMPLE_COUNTS              = 0x9380;
-const MIN_MAP_BUFFER_ALIGNMENT       = 0x90BC;
-const ATOMIC_COUNTER_BUFFER          = 0x92C0;
-const ATOMIC_COUNTER_BUFFER_BINDING  = 0x92C1;
-const ATOMIC_COUNTER_BUFFER_START    = 0x92C2;
-const ATOMIC_COUNTER_BUFFER_SIZE     = 0x92C3;
-const ATOMIC_COUNTER_BUFFER_DATA_SIZE = 0x92C4;
-const ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS = 0x92C5;
-const ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES = 0x92C6;
-const ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER = 0x92C7;
-const ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER = 0x92C8;
-const ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x92C9;
-const ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER = 0x92CA;
-const ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER = 0x92CB;
-const MAX_VERTEX_ATOMIC_COUNTER_BUFFERS = 0x92CC;
-const MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS = 0x92CD;
-const MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS = 0x92CE;
-const MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS = 0x92CF;
-const MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS = 0x92D0;
-const MAX_COMBINED_ATOMIC_COUNTER_BUFFERS = 0x92D1;
-const MAX_VERTEX_ATOMIC_COUNTERS     = 0x92D2;
-const MAX_TESS_CONTROL_ATOMIC_COUNTERS = 0x92D3;
-const MAX_TESS_EVALUATION_ATOMIC_COUNTERS = 0x92D4;
-const MAX_GEOMETRY_ATOMIC_COUNTERS   = 0x92D5;
-const MAX_FRAGMENT_ATOMIC_COUNTERS   = 0x92D6;
-const MAX_COMBINED_ATOMIC_COUNTERS   = 0x92D7;
-const MAX_ATOMIC_COUNTER_BUFFER_SIZE = 0x92D8;
-const MAX_ATOMIC_COUNTER_BUFFER_BINDINGS = 0x92DC;
-const ACTIVE_ATOMIC_COUNTER_BUFFERS  = 0x92D9;
-const UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX = 0x92DA;
-const UNSIGNED_INT_ATOMIC_COUNTER    = 0x92DB;
-const VERTEX_ATTRIB_ARRAY_BARRIER_BIT = 0x00000001;
-const ELEMENT_ARRAY_BARRIER_BIT      = 0x00000002;
-const UNIFORM_BARRIER_BIT            = 0x00000004;
-const TEXTURE_FETCH_BARRIER_BIT      = 0x00000008;
-const SHADER_IMAGE_ACCESS_BARRIER_BIT = 0x00000020;
-const COMMAND_BARRIER_BIT            = 0x00000040;
-const PIXEL_BUFFER_BARRIER_BIT       = 0x00000080;
-const TEXTURE_UPDATE_BARRIER_BIT     = 0x00000100;
-const BUFFER_UPDATE_BARRIER_BIT      = 0x00000200;
-const FRAMEBUFFER_BARRIER_BIT        = 0x00000400;
-const TRANSFORM_FEEDBACK_BARRIER_BIT = 0x00000800;
-const ATOMIC_COUNTER_BARRIER_BIT     = 0x00001000;
-const ALL_BARRIER_BITS               = 0xFFFFFFFF;
-const MAX_IMAGE_UNITS                = 0x8F38;
-const MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS = 0x8F39;
-const IMAGE_BINDING_NAME             = 0x8F3A;
-const IMAGE_BINDING_LEVEL            = 0x8F3B;
-const IMAGE_BINDING_LAYERED          = 0x8F3C;
-const IMAGE_BINDING_LAYER            = 0x8F3D;
-const IMAGE_BINDING_ACCESS           = 0x8F3E;
-const IMAGE_1D                       = 0x904C;
-const IMAGE_2D                       = 0x904D;
-const IMAGE_3D                       = 0x904E;
-const IMAGE_2D_RECT                  = 0x904F;
-const IMAGE_CUBE                     = 0x9050;
-const IMAGE_BUFFER                   = 0x9051;
-const IMAGE_1D_ARRAY                 = 0x9052;
-const IMAGE_2D_ARRAY                 = 0x9053;
-const IMAGE_CUBE_MAP_ARRAY           = 0x9054;
-const IMAGE_2D_MULTISAMPLE           = 0x9055;
-const IMAGE_2D_MULTISAMPLE_ARRAY     = 0x9056;
-const INT_IMAGE_1D                   = 0x9057;
-const INT_IMAGE_2D                   = 0x9058;
-const INT_IMAGE_3D                   = 0x9059;
-const INT_IMAGE_2D_RECT              = 0x905A;
-const INT_IMAGE_CUBE                 = 0x905B;
-const INT_IMAGE_BUFFER               = 0x905C;
-const INT_IMAGE_1D_ARRAY             = 0x905D;
-const INT_IMAGE_2D_ARRAY             = 0x905E;
-const INT_IMAGE_CUBE_MAP_ARRAY       = 0x905F;
-const INT_IMAGE_2D_MULTISAMPLE       = 0x9060;
-const INT_IMAGE_2D_MULTISAMPLE_ARRAY = 0x9061;
-const UNSIGNED_INT_IMAGE_1D          = 0x9062;
-const UNSIGNED_INT_IMAGE_2D          = 0x9063;
-const UNSIGNED_INT_IMAGE_3D          = 0x9064;
-const UNSIGNED_INT_IMAGE_2D_RECT     = 0x9065;
-const UNSIGNED_INT_IMAGE_CUBE        = 0x9066;
-const UNSIGNED_INT_IMAGE_BUFFER      = 0x9067;
-const UNSIGNED_INT_IMAGE_1D_ARRAY    = 0x9068;
-const UNSIGNED_INT_IMAGE_2D_ARRAY    = 0x9069;
-const UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY = 0x906A;
-const UNSIGNED_INT_IMAGE_2D_MULTISAMPLE = 0x906B;
-const UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY = 0x906C;
-const MAX_IMAGE_SAMPLES              = 0x906D;
-const IMAGE_BINDING_FORMAT           = 0x906E;
-const IMAGE_FORMAT_COMPATIBILITY_TYPE = 0x90C7;
-const IMAGE_FORMAT_COMPATIBILITY_BY_SIZE = 0x90C8;
-const IMAGE_FORMAT_COMPATIBILITY_BY_CLASS = 0x90C9;
-const MAX_VERTEX_IMAGE_UNIFORMS      = 0x90CA;
-const MAX_TESS_CONTROL_IMAGE_UNIFORMS = 0x90CB;
-const MAX_TESS_EVALUATION_IMAGE_UNIFORMS = 0x90CC;
-const MAX_GEOMETRY_IMAGE_UNIFORMS    = 0x90CD;
-const MAX_FRAGMENT_IMAGE_UNIFORMS    = 0x90CE;
-const MAX_COMBINED_IMAGE_UNIFORMS    = 0x90CF;
-const COMPRESSED_RGBA_BPTC_UNORM     = 0x8E8C;
-const COMPRESSED_SRGB_ALPHA_BPTC_UNORM = 0x8E8D;
-const COMPRESSED_RGB_BPTC_SIGNED_FLOAT = 0x8E8E;
-const COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT = 0x8E8F;
-const TEXTURE_IMMUTABLE_FORMAT       = 0x912F;
+	NUM_SHADING_LANGUAGE_VERSIONS  = 0x82E9;
+	VERTEX_ATTRIB_ARRAY_LONG       = 0x874E;
+	COMPRESSED_RGB8_ETC2           = 0x9274;
+	COMPRESSED_SRGB8_ETC2          = 0x9275;
+	COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9276;
+	COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9277;
+	COMPRESSED_RGBA8_ETC2_EAC      = 0x9278;
+	COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 0x9279;
+	COMPRESSED_R11_EAC             = 0x9270;
+	COMPRESSED_SIGNED_R11_EAC      = 0x9271;
+	COMPRESSED_RG11_EAC            = 0x9272;
+	COMPRESSED_SIGNED_RG11_EAC     = 0x9273;
+	PRIMITIVE_RESTART_FIXED_INDEX  = 0x8D69;
+	ANY_SAMPLES_PASSED_CONSERVATIVE = 0x8D6A;
+	MAX_ELEMENT_INDEX              = 0x8D6B;
+	COMPUTE_SHADER                 = 0x91B9;
+	MAX_COMPUTE_UNIFORM_BLOCKS     = 0x91BB;
+	MAX_COMPUTE_TEXTURE_IMAGE_UNITS = 0x91BC;
+	MAX_COMPUTE_IMAGE_UNIFORMS     = 0x91BD;
+	MAX_COMPUTE_SHARED_MEMORY_SIZE = 0x8262;
+	MAX_COMPUTE_UNIFORM_COMPONENTS = 0x8263;
+	MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS = 0x8264;
+	MAX_COMPUTE_ATOMIC_COUNTERS    = 0x8265;
+	MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS = 0x8266;
+	MAX_COMPUTE_WORK_GROUP_INVOCATIONS = 0x90EB;
+	MAX_COMPUTE_WORK_GROUP_COUNT   = 0x91BE;
+	MAX_COMPUTE_WORK_GROUP_SIZE    = 0x91BF;
+	COMPUTE_WORK_GROUP_SIZE        = 0x8267;
+	UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER = 0x90EC;
+	ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER = 0x90ED;
+	DISPATCH_INDIRECT_BUFFER       = 0x90EE;
+	DISPATCH_INDIRECT_BUFFER_BINDING = 0x90EF;
+	COMPUTE_SHADER_BIT             = 0x00000020;
+	DEBUG_OUTPUT_SYNCHRONOUS       = 0x8242;
+	DEBUG_NEXT_LOGGED_MESSAGE_LENGTH = 0x8243;
+	DEBUG_CALLBACK_FUNCTION        = 0x8244;
+	DEBUG_CALLBACK_USER_PARAM      = 0x8245;
+	DEBUG_SOURCE_API               = 0x8246;
+	DEBUG_SOURCE_WINDOW_SYSTEM     = 0x8247;
+	DEBUG_SOURCE_SHADER_COMPILER   = 0x8248;
+	DEBUG_SOURCE_THIRD_PARTY       = 0x8249;
+	DEBUG_SOURCE_APPLICATION       = 0x824A;
+	DEBUG_SOURCE_OTHER             = 0x824B;
+	DEBUG_TYPE_ERROR               = 0x824C;
+	DEBUG_TYPE_DEPRECATED_BEHAVIOR = 0x824D;
+	DEBUG_TYPE_UNDEFINED_BEHAVIOR  = 0x824E;
+	DEBUG_TYPE_PORTABILITY         = 0x824F;
+	DEBUG_TYPE_PERFORMANCE         = 0x8250;
+	DEBUG_TYPE_OTHER               = 0x8251;
+	MAX_DEBUG_MESSAGE_LENGTH       = 0x9143;
+	MAX_DEBUG_LOGGED_MESSAGES      = 0x9144;
+	DEBUG_LOGGED_MESSAGES          = 0x9145;
+	DEBUG_SEVERITY_HIGH            = 0x9146;
+	DEBUG_SEVERITY_MEDIUM          = 0x9147;
+	DEBUG_SEVERITY_LOW             = 0x9148;
+	DEBUG_TYPE_MARKER              = 0x8268;
+	DEBUG_TYPE_PUSH_GROUP          = 0x8269;
+	DEBUG_TYPE_POP_GROUP           = 0x826A;
+	DEBUG_SEVERITY_NOTIFICATION    = 0x826B;
+	MAX_DEBUG_GROUP_STACK_DEPTH    = 0x826C;
+	DEBUG_GROUP_STACK_DEPTH        = 0x826D;
+	BUFFER                         = 0x82E0;
+	SHADER                         = 0x82E1;
+	PROGRAM                        = 0x82E2;
+	QUERY                          = 0x82E3;
+	PROGRAM_PIPELINE               = 0x82E4;
+	SAMPLER                        = 0x82E6;
+	MAX_LABEL_LENGTH               = 0x82E8;
+	DEBUG_OUTPUT                   = 0x92E0;
+	CONTEXT_FLAG_DEBUG_BIT         = 0x00000002;
+	MAX_UNIFORM_LOCATIONS          = 0x826E;
+	FRAMEBUFFER_DEFAULT_WIDTH      = 0x9310;
+	FRAMEBUFFER_DEFAULT_HEIGHT     = 0x9311;
+	FRAMEBUFFER_DEFAULT_LAYERS     = 0x9312;
+	FRAMEBUFFER_DEFAULT_SAMPLES    = 0x9313;
+	FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS = 0x9314;
+	MAX_FRAMEBUFFER_WIDTH          = 0x9315;
+	MAX_FRAMEBUFFER_HEIGHT         = 0x9316;
+	MAX_FRAMEBUFFER_LAYERS         = 0x9317;
+	MAX_FRAMEBUFFER_SAMPLES        = 0x9318;
+	INTERNALFORMAT_SUPPORTED       = 0x826F;
+	INTERNALFORMAT_PREFERRED       = 0x8270;
+	INTERNALFORMAT_RED_SIZE        = 0x8271;
+	INTERNALFORMAT_GREEN_SIZE      = 0x8272;
+	INTERNALFORMAT_BLUE_SIZE       = 0x8273;
+	INTERNALFORMAT_ALPHA_SIZE      = 0x8274;
+	INTERNALFORMAT_DEPTH_SIZE      = 0x8275;
+	INTERNALFORMAT_STENCIL_SIZE    = 0x8276;
+	INTERNALFORMAT_SHARED_SIZE     = 0x8277;
+	INTERNALFORMAT_RED_TYPE        = 0x8278;
+	INTERNALFORMAT_GREEN_TYPE      = 0x8279;
+	INTERNALFORMAT_BLUE_TYPE       = 0x827A;
+	INTERNALFORMAT_ALPHA_TYPE      = 0x827B;
+	INTERNALFORMAT_DEPTH_TYPE      = 0x827C;
+	INTERNALFORMAT_STENCIL_TYPE    = 0x827D;
+	MAX_WIDTH                      = 0x827E;
+	MAX_HEIGHT                     = 0x827F;
+	MAX_DEPTH                      = 0x8280;
+	MAX_LAYERS                     = 0x8281;
+	MAX_COMBINED_DIMENSIONS        = 0x8282;
+	COLOR_COMPONENTS               = 0x8283;
+	DEPTH_COMPONENTS               = 0x8284;
+	STENCIL_COMPONENTS             = 0x8285;
+	COLOR_RENDERABLE               = 0x8286;
+	DEPTH_RENDERABLE               = 0x8287;
+	STENCIL_RENDERABLE             = 0x8288;
+	FRAMEBUFFER_RENDERABLE         = 0x8289;
+	FRAMEBUFFER_RENDERABLE_LAYERED = 0x828A;
+	FRAMEBUFFER_BLEND              = 0x828B;
+	READ_PIXELS                    = 0x828C;
+	READ_PIXELS_FORMAT             = 0x828D;
+	READ_PIXELS_TYPE               = 0x828E;
+	TEXTURE_IMAGE_FORMAT           = 0x828F;
+	TEXTURE_IMAGE_TYPE             = 0x8290;
+	GET_TEXTURE_IMAGE_FORMAT       = 0x8291;
+	GET_TEXTURE_IMAGE_TYPE         = 0x8292;
+	MIPMAP                         = 0x8293;
+	MANUAL_GENERATE_MIPMAP         = 0x8294;
+	AUTO_GENERATE_MIPMAP           = 0x8295;
+	COLOR_ENCODING                 = 0x8296;
+	SRGB_READ                      = 0x8297;
+	SRGB_WRITE                     = 0x8298;
+	FILTER                         = 0x829A;
+	VERTEX_TEXTURE                 = 0x829B;
+	TESS_CONTROL_TEXTURE           = 0x829C;
+	TESS_EVALUATION_TEXTURE        = 0x829D;
+	GEOMETRY_TEXTURE               = 0x829E;
+	FRAGMENT_TEXTURE               = 0x829F;
+	COMPUTE_TEXTURE                = 0x82A0;
+	TEXTURE_SHADOW                 = 0x82A1;
+	TEXTURE_GATHER                 = 0x82A2;
+	TEXTURE_GATHER_SHADOW          = 0x82A3;
+	SHADER_IMAGE_LOAD              = 0x82A4;
+	SHADER_IMAGE_STORE             = 0x82A5;
+	SHADER_IMAGE_ATOMIC            = 0x82A6;
+	IMAGE_TEXEL_SIZE               = 0x82A7;
+	IMAGE_COMPATIBILITY_CLASS      = 0x82A8;
+	IMAGE_PIXEL_FORMAT             = 0x82A9;
+	IMAGE_PIXEL_TYPE               = 0x82AA;
+	SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST = 0x82AC;
+	SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST = 0x82AD;
+	SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE = 0x82AE;
+	SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE = 0x82AF;
+	TEXTURE_COMPRESSED_BLOCK_WIDTH = 0x82B1;
+	TEXTURE_COMPRESSED_BLOCK_HEIGHT = 0x82B2;
+	TEXTURE_COMPRESSED_BLOCK_SIZE  = 0x82B3;
+	CLEAR_BUFFER                   = 0x82B4;
+	TEXTURE_VIEW                   = 0x82B5;
+	VIEW_COMPATIBILITY_CLASS       = 0x82B6;
+	FULL_SUPPORT                   = 0x82B7;
+	CAVEAT_SUPPORT                 = 0x82B8;
+	IMAGE_CLASS_4_X_32             = 0x82B9;
+	IMAGE_CLASS_2_X_32             = 0x82BA;
+	IMAGE_CLASS_1_X_32             = 0x82BB;
+	IMAGE_CLASS_4_X_16             = 0x82BC;
+	IMAGE_CLASS_2_X_16             = 0x82BD;
+	IMAGE_CLASS_1_X_16             = 0x82BE;
+	IMAGE_CLASS_4_X_8              = 0x82BF;
+	IMAGE_CLASS_2_X_8              = 0x82C0;
+	IMAGE_CLASS_1_X_8              = 0x82C1;
+	IMAGE_CLASS_11_11_10           = 0x82C2;
+	IMAGE_CLASS_10_10_10_2         = 0x82C3;
+	VIEW_CLASS_128_BITS            = 0x82C4;
+	VIEW_CLASS_96_BITS             = 0x82C5;
+	VIEW_CLASS_64_BITS             = 0x82C6;
+	VIEW_CLASS_48_BITS             = 0x82C7;
+	VIEW_CLASS_32_BITS             = 0x82C8;
+	VIEW_CLASS_24_BITS             = 0x82C9;
+	VIEW_CLASS_16_BITS             = 0x82CA;
+	VIEW_CLASS_8_BITS              = 0x82CB;
+	VIEW_CLASS_S3TC_DXT1_RGB       = 0x82CC;
+	VIEW_CLASS_S3TC_DXT1_RGBA      = 0x82CD;
+	VIEW_CLASS_S3TC_DXT3_RGBA      = 0x82CE;
+	VIEW_CLASS_S3TC_DXT5_RGBA      = 0x82CF;
+	VIEW_CLASS_RGTC1_RED           = 0x82D0;
+	VIEW_CLASS_RGTC2_RG            = 0x82D1;
+	VIEW_CLASS_BPTC_UNORM          = 0x82D2;
+	VIEW_CLASS_BPTC_FLOAT          = 0x82D3;
+	UNIFORM                        = 0x92E1;
+	UNIFORM_BLOCK                  = 0x92E2;
+	PROGRAM_INPUT                  = 0x92E3;
+	PROGRAM_OUTPUT                 = 0x92E4;
+	BUFFER_VARIABLE                = 0x92E5;
+	SHADER_STORAGE_BLOCK           = 0x92E6;
+	VERTEX_SUBROUTINE              = 0x92E8;
+	TESS_CONTROL_SUBROUTINE        = 0x92E9;
+	TESS_EVALUATION_SUBROUTINE     = 0x92EA;
+	GEOMETRY_SUBROUTINE            = 0x92EB;
+	FRAGMENT_SUBROUTINE            = 0x92EC;
+	COMPUTE_SUBROUTINE             = 0x92ED;
+	VERTEX_SUBROUTINE_UNIFORM      = 0x92EE;
+	TESS_CONTROL_SUBROUTINE_UNIFORM = 0x92EF;
+	TESS_EVALUATION_SUBROUTINE_UNIFORM = 0x92F0;
+	GEOMETRY_SUBROUTINE_UNIFORM    = 0x92F1;
+	FRAGMENT_SUBROUTINE_UNIFORM    = 0x92F2;
+	COMPUTE_SUBROUTINE_UNIFORM     = 0x92F3;
+	TRANSFORM_FEEDBACK_VARYING     = 0x92F4;
+	ACTIVE_RESOURCES               = 0x92F5;
+	MAX_NAME_LENGTH                = 0x92F6;
+	MAX_NUM_ACTIVE_VARIABLES       = 0x92F7;
+	MAX_NUM_COMPATIBLE_SUBROUTINES = 0x92F8;
+	NAME_LENGTH                    = 0x92F9;
+	TYPE                           = 0x92FA;
+	ARRAY_SIZE                     = 0x92FB;
+	OFFSET                         = 0x92FC;
+	BLOCK_INDEX                    = 0x92FD;
+	ARRAY_STRIDE                   = 0x92FE;
+	MATRIX_STRIDE                  = 0x92FF;
+	IS_ROW_MAJOR                   = 0x9300;
+	ATOMIC_COUNTER_BUFFER_INDEX    = 0x9301;
+	BUFFER_BINDING                 = 0x9302;
+	BUFFER_DATA_SIZE               = 0x9303;
+	NUM_ACTIVE_VARIABLES           = 0x9304;
+	ACTIVE_VARIABLES               = 0x9305;
+	REFERENCED_BY_VERTEX_SHADER    = 0x9306;
+	REFERENCED_BY_TESS_CONTROL_SHADER = 0x9307;
+	REFERENCED_BY_TESS_EVALUATION_SHADER = 0x9308;
+	REFERENCED_BY_GEOMETRY_SHADER  = 0x9309;
+	REFERENCED_BY_FRAGMENT_SHADER  = 0x930A;
+	REFERENCED_BY_COMPUTE_SHADER   = 0x930B;
+	TOP_LEVEL_ARRAY_SIZE           = 0x930C;
+	TOP_LEVEL_ARRAY_STRIDE         = 0x930D;
+	LOCATION                       = 0x930E;
+	LOCATION_INDEX                 = 0x930F;
+	IS_PER_PATCH                   = 0x92E7;
+	SHADER_STORAGE_BUFFER          = 0x90D2;
+	SHADER_STORAGE_BUFFER_BINDING  = 0x90D3;
+	SHADER_STORAGE_BUFFER_START    = 0x90D4;
+	SHADER_STORAGE_BUFFER_SIZE     = 0x90D5;
+	MAX_VERTEX_SHADER_STORAGE_BLOCKS = 0x90D6;
+	MAX_GEOMETRY_SHADER_STORAGE_BLOCKS = 0x90D7;
+	MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS = 0x90D8;
+	MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS = 0x90D9;
+	MAX_FRAGMENT_SHADER_STORAGE_BLOCKS = 0x90DA;
+	MAX_COMPUTE_SHADER_STORAGE_BLOCKS = 0x90DB;
+	MAX_COMBINED_SHADER_STORAGE_BLOCKS = 0x90DC;
+	MAX_SHADER_STORAGE_BUFFER_BINDINGS = 0x90DD;
+	MAX_SHADER_STORAGE_BLOCK_SIZE  = 0x90DE;
+	SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT = 0x90DF;
+	SHADER_STORAGE_BARRIER_BIT     = 0x00002000;
+	MAX_COMBINED_SHADER_OUTPUT_RESOURCES = 0x8F39;
+	DEPTH_STENCIL_TEXTURE_MODE     = 0x90EA;
+	TEXTURE_BUFFER_OFFSET          = 0x919D;
+	TEXTURE_BUFFER_SIZE            = 0x919E;
+	TEXTURE_BUFFER_OFFSET_ALIGNMENT = 0x919F;
+	TEXTURE_VIEW_MIN_LEVEL         = 0x82DB;
+	TEXTURE_VIEW_NUM_LEVELS        = 0x82DC;
+	TEXTURE_VIEW_MIN_LAYER         = 0x82DD;
+	TEXTURE_VIEW_NUM_LAYERS        = 0x82DE;
+	TEXTURE_IMMUTABLE_LEVELS       = 0x82DF;
+	VERTEX_ATTRIB_BINDING          = 0x82D4;
+	VERTEX_ATTRIB_RELATIVE_OFFSET  = 0x82D5;
+	VERTEX_BINDING_DIVISOR         = 0x82D6;
+	VERTEX_BINDING_OFFSET          = 0x82D7;
+	VERTEX_BINDING_STRIDE          = 0x82D8;
+	MAX_VERTEX_ATTRIB_RELATIVE_OFFSET = 0x82D9;
+	MAX_VERTEX_ATTRIB_BINDINGS     = 0x82DA;
+	VERTEX_BINDING_BUFFER          = 0x8F4F;
 
-const NUM_SHADING_LANGUAGE_VERSIONS  = 0x82E9;
-const VERTEX_ATTRIB_ARRAY_LONG       = 0x874E;
-const COMPRESSED_RGB8_ETC2           = 0x9274;
-const COMPRESSED_SRGB8_ETC2          = 0x9275;
-const COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9276;
-const COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9277;
-const COMPRESSED_RGBA8_ETC2_EAC      = 0x9278;
-const COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 0x9279;
-const COMPRESSED_R11_EAC             = 0x9270;
-const COMPRESSED_SIGNED_R11_EAC      = 0x9271;
-const COMPRESSED_RG11_EAC            = 0x9272;
-const COMPRESSED_SIGNED_RG11_EAC     = 0x9273;
-const PRIMITIVE_RESTART_FIXED_INDEX  = 0x8D69;
-const ANY_SAMPLES_PASSED_CONSERVATIVE = 0x8D6A;
-const MAX_ELEMENT_INDEX              = 0x8D6B;
-const COMPUTE_SHADER                 = 0x91B9;
-const MAX_COMPUTE_UNIFORM_BLOCKS     = 0x91BB;
-const MAX_COMPUTE_TEXTURE_IMAGE_UNITS = 0x91BC;
-const MAX_COMPUTE_IMAGE_UNIFORMS     = 0x91BD;
-const MAX_COMPUTE_SHARED_MEMORY_SIZE = 0x8262;
-const MAX_COMPUTE_UNIFORM_COMPONENTS = 0x8263;
-const MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS = 0x8264;
-const MAX_COMPUTE_ATOMIC_COUNTERS    = 0x8265;
-const MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS = 0x8266;
-const MAX_COMPUTE_WORK_GROUP_INVOCATIONS = 0x90EB;
-const MAX_COMPUTE_WORK_GROUP_COUNT   = 0x91BE;
-const MAX_COMPUTE_WORK_GROUP_SIZE    = 0x91BF;
-const COMPUTE_WORK_GROUP_SIZE        = 0x8267;
-const UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER = 0x90EC;
-const ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER = 0x90ED;
-const DISPATCH_INDIRECT_BUFFER       = 0x90EE;
-const DISPATCH_INDIRECT_BUFFER_BINDING = 0x90EF;
-const COMPUTE_SHADER_BIT             = 0x00000020;
-const DEBUG_OUTPUT_SYNCHRONOUS       = 0x8242;
-const DEBUG_NEXT_LOGGED_MESSAGE_LENGTH = 0x8243;
-const DEBUG_CALLBACK_FUNCTION        = 0x8244;
-const DEBUG_CALLBACK_USER_PARAM      = 0x8245;
-const DEBUG_SOURCE_API               = 0x8246;
-const DEBUG_SOURCE_WINDOW_SYSTEM     = 0x8247;
-const DEBUG_SOURCE_SHADER_COMPILER   = 0x8248;
-const DEBUG_SOURCE_THIRD_PARTY       = 0x8249;
-const DEBUG_SOURCE_APPLICATION       = 0x824A;
-const DEBUG_SOURCE_OTHER             = 0x824B;
-const DEBUG_TYPE_ERROR               = 0x824C;
-const DEBUG_TYPE_DEPRECATED_BEHAVIOR = 0x824D;
-const DEBUG_TYPE_UNDEFINED_BEHAVIOR  = 0x824E;
-const DEBUG_TYPE_PORTABILITY         = 0x824F;
-const DEBUG_TYPE_PERFORMANCE         = 0x8250;
-const DEBUG_TYPE_OTHER               = 0x8251;
-const MAX_DEBUG_MESSAGE_LENGTH       = 0x9143;
-const MAX_DEBUG_LOGGED_MESSAGES      = 0x9144;
-const DEBUG_LOGGED_MESSAGES          = 0x9145;
-const DEBUG_SEVERITY_HIGH            = 0x9146;
-const DEBUG_SEVERITY_MEDIUM          = 0x9147;
-const DEBUG_SEVERITY_LOW             = 0x9148;
-const DEBUG_TYPE_MARKER              = 0x8268;
-const DEBUG_TYPE_PUSH_GROUP          = 0x8269;
-const DEBUG_TYPE_POP_GROUP           = 0x826A;
-const DEBUG_SEVERITY_NOTIFICATION    = 0x826B;
-const MAX_DEBUG_GROUP_STACK_DEPTH    = 0x826C;
-const DEBUG_GROUP_STACK_DEPTH        = 0x826D;
-const BUFFER                         = 0x82E0;
-const SHADER                         = 0x82E1;
-const PROGRAM                        = 0x82E2;
-const QUERY                          = 0x82E3;
-const PROGRAM_PIPELINE               = 0x82E4;
-const SAMPLER                        = 0x82E6;
-const MAX_LABEL_LENGTH               = 0x82E8;
-const DEBUG_OUTPUT                   = 0x92E0;
-const CONTEXT_FLAG_DEBUG_BIT         = 0x00000002;
-const MAX_UNIFORM_LOCATIONS          = 0x826E;
-const FRAMEBUFFER_DEFAULT_WIDTH      = 0x9310;
-const FRAMEBUFFER_DEFAULT_HEIGHT     = 0x9311;
-const FRAMEBUFFER_DEFAULT_LAYERS     = 0x9312;
-const FRAMEBUFFER_DEFAULT_SAMPLES    = 0x9313;
-const FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS = 0x9314;
-const MAX_FRAMEBUFFER_WIDTH          = 0x9315;
-const MAX_FRAMEBUFFER_HEIGHT         = 0x9316;
-const MAX_FRAMEBUFFER_LAYERS         = 0x9317;
-const MAX_FRAMEBUFFER_SAMPLES        = 0x9318;
-const INTERNALFORMAT_SUPPORTED       = 0x826F;
-const INTERNALFORMAT_PREFERRED       = 0x8270;
-const INTERNALFORMAT_RED_SIZE        = 0x8271;
-const INTERNALFORMAT_GREEN_SIZE      = 0x8272;
-const INTERNALFORMAT_BLUE_SIZE       = 0x8273;
-const INTERNALFORMAT_ALPHA_SIZE      = 0x8274;
-const INTERNALFORMAT_DEPTH_SIZE      = 0x8275;
-const INTERNALFORMAT_STENCIL_SIZE    = 0x8276;
-const INTERNALFORMAT_SHARED_SIZE     = 0x8277;
-const INTERNALFORMAT_RED_TYPE        = 0x8278;
-const INTERNALFORMAT_GREEN_TYPE      = 0x8279;
-const INTERNALFORMAT_BLUE_TYPE       = 0x827A;
-const INTERNALFORMAT_ALPHA_TYPE      = 0x827B;
-const INTERNALFORMAT_DEPTH_TYPE      = 0x827C;
-const INTERNALFORMAT_STENCIL_TYPE    = 0x827D;
-const MAX_WIDTH                      = 0x827E;
-const MAX_HEIGHT                     = 0x827F;
-const MAX_DEPTH                      = 0x8280;
-const MAX_LAYERS                     = 0x8281;
-const MAX_COMBINED_DIMENSIONS        = 0x8282;
-const COLOR_COMPONENTS               = 0x8283;
-const DEPTH_COMPONENTS               = 0x8284;
-const STENCIL_COMPONENTS             = 0x8285;
-const COLOR_RENDERABLE               = 0x8286;
-const DEPTH_RENDERABLE               = 0x8287;
-const STENCIL_RENDERABLE             = 0x8288;
-const FRAMEBUFFER_RENDERABLE         = 0x8289;
-const FRAMEBUFFER_RENDERABLE_LAYERED = 0x828A;
-const FRAMEBUFFER_BLEND              = 0x828B;
-const READ_PIXELS                    = 0x828C;
-const READ_PIXELS_FORMAT             = 0x828D;
-const READ_PIXELS_TYPE               = 0x828E;
-const TEXTURE_IMAGE_FORMAT           = 0x828F;
-const TEXTURE_IMAGE_TYPE             = 0x8290;
-const GET_TEXTURE_IMAGE_FORMAT       = 0x8291;
-const GET_TEXTURE_IMAGE_TYPE         = 0x8292;
-const MIPMAP                         = 0x8293;
-const MANUAL_GENERATE_MIPMAP         = 0x8294;
-const AUTO_GENERATE_MIPMAP           = 0x8295;
-const COLOR_ENCODING                 = 0x8296;
-const SRGB_READ                      = 0x8297;
-const SRGB_WRITE                     = 0x8298;
-const FILTER                         = 0x829A;
-const VERTEX_TEXTURE                 = 0x829B;
-const TESS_CONTROL_TEXTURE           = 0x829C;
-const TESS_EVALUATION_TEXTURE        = 0x829D;
-const GEOMETRY_TEXTURE               = 0x829E;
-const FRAGMENT_TEXTURE               = 0x829F;
-const COMPUTE_TEXTURE                = 0x82A0;
-const TEXTURE_SHADOW                 = 0x82A1;
-const TEXTURE_GATHER                 = 0x82A2;
-const TEXTURE_GATHER_SHADOW          = 0x82A3;
-const SHADER_IMAGE_LOAD              = 0x82A4;
-const SHADER_IMAGE_STORE             = 0x82A5;
-const SHADER_IMAGE_ATOMIC            = 0x82A6;
-const IMAGE_TEXEL_SIZE               = 0x82A7;
-const IMAGE_COMPATIBILITY_CLASS      = 0x82A8;
-const IMAGE_PIXEL_FORMAT             = 0x82A9;
-const IMAGE_PIXEL_TYPE               = 0x82AA;
-const SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST = 0x82AC;
-const SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST = 0x82AD;
-const SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE = 0x82AE;
-const SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE = 0x82AF;
-const TEXTURE_COMPRESSED_BLOCK_WIDTH = 0x82B1;
-const TEXTURE_COMPRESSED_BLOCK_HEIGHT = 0x82B2;
-const TEXTURE_COMPRESSED_BLOCK_SIZE  = 0x82B3;
-const CLEAR_BUFFER                   = 0x82B4;
-const TEXTURE_VIEW                   = 0x82B5;
-const VIEW_COMPATIBILITY_CLASS       = 0x82B6;
-const FULL_SUPPORT                   = 0x82B7;
-const CAVEAT_SUPPORT                 = 0x82B8;
-const IMAGE_CLASS_4_X_32             = 0x82B9;
-const IMAGE_CLASS_2_X_32             = 0x82BA;
-const IMAGE_CLASS_1_X_32             = 0x82BB;
-const IMAGE_CLASS_4_X_16             = 0x82BC;
-const IMAGE_CLASS_2_X_16             = 0x82BD;
-const IMAGE_CLASS_1_X_16             = 0x82BE;
-const IMAGE_CLASS_4_X_8              = 0x82BF;
-const IMAGE_CLASS_2_X_8              = 0x82C0;
-const IMAGE_CLASS_1_X_8              = 0x82C1;
-const IMAGE_CLASS_11_11_10           = 0x82C2;
-const IMAGE_CLASS_10_10_10_2         = 0x82C3;
-const VIEW_CLASS_128_BITS            = 0x82C4;
-const VIEW_CLASS_96_BITS             = 0x82C5;
-const VIEW_CLASS_64_BITS             = 0x82C6;
-const VIEW_CLASS_48_BITS             = 0x82C7;
-const VIEW_CLASS_32_BITS             = 0x82C8;
-const VIEW_CLASS_24_BITS             = 0x82C9;
-const VIEW_CLASS_16_BITS             = 0x82CA;
-const VIEW_CLASS_8_BITS              = 0x82CB;
-const VIEW_CLASS_S3TC_DXT1_RGB       = 0x82CC;
-const VIEW_CLASS_S3TC_DXT1_RGBA      = 0x82CD;
-const VIEW_CLASS_S3TC_DXT3_RGBA      = 0x82CE;
-const VIEW_CLASS_S3TC_DXT5_RGBA      = 0x82CF;
-const VIEW_CLASS_RGTC1_RED           = 0x82D0;
-const VIEW_CLASS_RGTC2_RG            = 0x82D1;
-const VIEW_CLASS_BPTC_UNORM          = 0x82D2;
-const VIEW_CLASS_BPTC_FLOAT          = 0x82D3;
-const UNIFORM                        = 0x92E1;
-const UNIFORM_BLOCK                  = 0x92E2;
-const PROGRAM_INPUT                  = 0x92E3;
-const PROGRAM_OUTPUT                 = 0x92E4;
-const BUFFER_VARIABLE                = 0x92E5;
-const SHADER_STORAGE_BLOCK           = 0x92E6;
-const VERTEX_SUBROUTINE              = 0x92E8;
-const TESS_CONTROL_SUBROUTINE        = 0x92E9;
-const TESS_EVALUATION_SUBROUTINE     = 0x92EA;
-const GEOMETRY_SUBROUTINE            = 0x92EB;
-const FRAGMENT_SUBROUTINE            = 0x92EC;
-const COMPUTE_SUBROUTINE             = 0x92ED;
-const VERTEX_SUBROUTINE_UNIFORM      = 0x92EE;
-const TESS_CONTROL_SUBROUTINE_UNIFORM = 0x92EF;
-const TESS_EVALUATION_SUBROUTINE_UNIFORM = 0x92F0;
-const GEOMETRY_SUBROUTINE_UNIFORM    = 0x92F1;
-const FRAGMENT_SUBROUTINE_UNIFORM    = 0x92F2;
-const COMPUTE_SUBROUTINE_UNIFORM     = 0x92F3;
-const TRANSFORM_FEEDBACK_VARYING     = 0x92F4;
-const ACTIVE_RESOURCES               = 0x92F5;
-const MAX_NAME_LENGTH                = 0x92F6;
-const MAX_NUM_ACTIVE_VARIABLES       = 0x92F7;
-const MAX_NUM_COMPATIBLE_SUBROUTINES = 0x92F8;
-const NAME_LENGTH                    = 0x92F9;
-const TYPE                           = 0x92FA;
-const ARRAY_SIZE                     = 0x92FB;
-const OFFSET                         = 0x92FC;
-const BLOCK_INDEX                    = 0x92FD;
-const ARRAY_STRIDE                   = 0x92FE;
-const MATRIX_STRIDE                  = 0x92FF;
-const IS_ROW_MAJOR                   = 0x9300;
-const ATOMIC_COUNTER_BUFFER_INDEX    = 0x9301;
-const BUFFER_BINDING                 = 0x9302;
-const BUFFER_DATA_SIZE               = 0x9303;
-const NUM_ACTIVE_VARIABLES           = 0x9304;
-const ACTIVE_VARIABLES               = 0x9305;
-const REFERENCED_BY_VERTEX_SHADER    = 0x9306;
-const REFERENCED_BY_TESS_CONTROL_SHADER = 0x9307;
-const REFERENCED_BY_TESS_EVALUATION_SHADER = 0x9308;
-const REFERENCED_BY_GEOMETRY_SHADER  = 0x9309;
-const REFERENCED_BY_FRAGMENT_SHADER  = 0x930A;
-const REFERENCED_BY_COMPUTE_SHADER   = 0x930B;
-const TOP_LEVEL_ARRAY_SIZE           = 0x930C;
-const TOP_LEVEL_ARRAY_STRIDE         = 0x930D;
-const LOCATION                       = 0x930E;
-const LOCATION_INDEX                 = 0x930F;
-const IS_PER_PATCH                   = 0x92E7;
-const SHADER_STORAGE_BUFFER          = 0x90D2;
-const SHADER_STORAGE_BUFFER_BINDING  = 0x90D3;
-const SHADER_STORAGE_BUFFER_START    = 0x90D4;
-const SHADER_STORAGE_BUFFER_SIZE     = 0x90D5;
-const MAX_VERTEX_SHADER_STORAGE_BLOCKS = 0x90D6;
-const MAX_GEOMETRY_SHADER_STORAGE_BLOCKS = 0x90D7;
-const MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS = 0x90D8;
-const MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS = 0x90D9;
-const MAX_FRAGMENT_SHADER_STORAGE_BLOCKS = 0x90DA;
-const MAX_COMPUTE_SHADER_STORAGE_BLOCKS = 0x90DB;
-const MAX_COMBINED_SHADER_STORAGE_BLOCKS = 0x90DC;
-const MAX_SHADER_STORAGE_BUFFER_BINDINGS = 0x90DD;
-const MAX_SHADER_STORAGE_BLOCK_SIZE  = 0x90DE;
-const SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT = 0x90DF;
-const SHADER_STORAGE_BARRIER_BIT     = 0x00002000;
-const MAX_COMBINED_SHADER_OUTPUT_RESOURCES = 0x8F39;
-const DEPTH_STENCIL_TEXTURE_MODE     = 0x90EA;
-const TEXTURE_BUFFER_OFFSET          = 0x919D;
-const TEXTURE_BUFFER_SIZE            = 0x919E;
-const TEXTURE_BUFFER_OFFSET_ALIGNMENT = 0x919F;
-const TEXTURE_VIEW_MIN_LEVEL         = 0x82DB;
-const TEXTURE_VIEW_NUM_LEVELS        = 0x82DC;
-const TEXTURE_VIEW_MIN_LAYER         = 0x82DD;
-const TEXTURE_VIEW_NUM_LAYERS        = 0x82DE;
-const TEXTURE_IMMUTABLE_LEVELS       = 0x82DF;
-const VERTEX_ATTRIB_BINDING          = 0x82D4;
-const VERTEX_ATTRIB_RELATIVE_OFFSET  = 0x82D5;
-const VERTEX_BINDING_DIVISOR         = 0x82D6;
-const VERTEX_BINDING_OFFSET          = 0x82D7;
-const VERTEX_BINDING_STRIDE          = 0x82D8;
-const MAX_VERTEX_ATTRIB_RELATIVE_OFFSET = 0x82D9;
-const MAX_VERTEX_ATTRIB_BINDINGS     = 0x82DA;
-const VERTEX_BINDING_BUFFER          = 0x8F4F;
+	MAX_VERTEX_ATTRIB_STRIDE       = 0x82E5;
+	PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED = 0x8221;
+	TEXTURE_BUFFER_BINDING         = 0x8C2A;
+	MAP_PERSISTENT_BIT             = 0x0040;
+	MAP_COHERENT_BIT               = 0x0080;
+	DYNAMIC_STORAGE_BIT            = 0x0100;
+	CLIENT_STORAGE_BIT             = 0x0200;
+	CLIENT_MAPPED_BUFFER_BARRIER_BIT = 0x00004000;
+	BUFFER_IMMUTABLE_STORAGE       = 0x821F;
+	BUFFER_STORAGE_FLAGS           = 0x8220;
+	CLEAR_TEXTURE                  = 0x9365;
+	LOCATION_COMPONENT             = 0x934A;
+	TRANSFORM_FEEDBACK_BUFFER_INDEX = 0x934B;
+	TRANSFORM_FEEDBACK_BUFFER_STRIDE = 0x934C;
+	QUERY_BUFFER                   = 0x9192;
+	QUERY_BUFFER_BARRIER_BIT       = 0x00008000;
+	QUERY_BUFFER_BINDING           = 0x9193;
+	QUERY_RESULT_NO_WAIT           = 0x9194;
+	MIRROR_CLAMP_TO_EDGE           = 0x8743;
 
-const MAX_VERTEX_ATTRIB_STRIDE       = 0x82E5;
-const PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED = 0x8221;
-const TEXTURE_BUFFER_BINDING         = 0x8C2A;
-const MAP_PERSISTENT_BIT             = 0x0040;
-const MAP_COHERENT_BIT               = 0x0080;
-const DYNAMIC_STORAGE_BIT            = 0x0100;
-const CLIENT_STORAGE_BIT             = 0x0200;
-const CLIENT_MAPPED_BUFFER_BARRIER_BIT = 0x00004000;
-const BUFFER_IMMUTABLE_STORAGE       = 0x821F;
-const BUFFER_STORAGE_FLAGS           = 0x8220;
-const CLEAR_TEXTURE                  = 0x9365;
-const LOCATION_COMPONENT             = 0x934A;
-const TRANSFORM_FEEDBACK_BUFFER_INDEX = 0x934B;
-const TRANSFORM_FEEDBACK_BUFFER_STRIDE = 0x934C;
-const QUERY_BUFFER                   = 0x9192;
-const QUERY_BUFFER_BARRIER_BIT       = 0x00008000;
-const QUERY_BUFFER_BINDING           = 0x9193;
-const QUERY_RESULT_NO_WAIT           = 0x9194;
-const MIRROR_CLAMP_TO_EDGE           = 0x8743;
-
-const CONTEXT_LOST                   = 0x0507;
-const NEGATIVE_ONE_TO_ONE            = 0x935E;
-const ZERO_TO_ONE                    = 0x935F;
-const CLIP_ORIGIN                    = 0x935C;
-const CLIP_DEPTH_MODE                = 0x935D;
-const QUERY_WAIT_INVERTED            = 0x8E17;
-const QUERY_NO_WAIT_INVERTED         = 0x8E18;
-const QUERY_BY_REGION_WAIT_INVERTED  = 0x8E19;
-const QUERY_BY_REGION_NO_WAIT_INVERTED = 0x8E1A;
-const MAX_CULL_DISTANCES             = 0x82F9;
-const MAX_COMBINED_CLIP_AND_CULL_DISTANCES = 0x82FA;
-const TEXTURE_TARGET                 = 0x1006;
-const QUERY_TARGET                   = 0x82EA;
-const GUILTY_CONTEXT_RESET           = 0x8253;
-const INNOCENT_CONTEXT_RESET         = 0x8254;
-const UNKNOWN_CONTEXT_RESET          = 0x8255;
-const RESET_NOTIFICATION_STRATEGY    = 0x8256;
-const LOSE_CONTEXT_ON_RESET          = 0x8252;
-const NO_RESET_NOTIFICATION          = 0x8261;
-const CONTEXT_FLAG_ROBUST_ACCESS_BIT = 0x00000004;
-const CONTEXT_RELEASE_BEHAVIOR       = 0x82FB;
-const CONTEXT_RELEASE_BEHAVIOR_FLUSH = 0x82FC;
-
-const DEBUG_OUTPUT_SYNCHRONOUS_ARB   = 0x8242;
-const DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB = 0x8243;
-const DEBUG_CALLBACK_FUNCTION_ARB    = 0x8244;
-const DEBUG_CALLBACK_USER_PARAM_ARB  = 0x8245;
-const DEBUG_SOURCE_API_ARB           = 0x8246;
-const DEBUG_SOURCE_WINDOW_SYSTEM_ARB = 0x8247;
-const DEBUG_SOURCE_SHADER_COMPILER_ARB = 0x8248;
-const DEBUG_SOURCE_THIRD_PARTY_ARB   = 0x8249;
-const DEBUG_SOURCE_APPLICATION_ARB   = 0x824A;
-const DEBUG_SOURCE_OTHER_ARB         = 0x824B;
-const DEBUG_TYPE_ERROR_ARB           = 0x824C;
-const DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB = 0x824D;
-const DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB = 0x824E;
-const DEBUG_TYPE_PORTABILITY_ARB     = 0x824F;
-const DEBUG_TYPE_PERFORMANCE_ARB     = 0x8250;
-const DEBUG_TYPE_OTHER_ARB           = 0x8251;
-const MAX_DEBUG_MESSAGE_LENGTH_ARB   = 0x9143;
-const MAX_DEBUG_LOGGED_MESSAGES_ARB  = 0x9144;
-const DEBUG_LOGGED_MESSAGES_ARB      = 0x9145;
-const DEBUG_SEVERITY_HIGH_ARB        = 0x9146;
-const DEBUG_SEVERITY_MEDIUM_ARB      = 0x9147;
-const DEBUG_SEVERITY_LOW_ARB         = 0x9148;
+	CONTEXT_LOST                   = 0x0507;
+	NEGATIVE_ONE_TO_ONE            = 0x935E;
+	ZERO_TO_ONE                    = 0x935F;
+	CLIP_ORIGIN                    = 0x935C;
+	CLIP_DEPTH_MODE                = 0x935D;
+	QUERY_WAIT_INVERTED            = 0x8E17;
+	QUERY_NO_WAIT_INVERTED         = 0x8E18;
+	QUERY_BY_REGION_WAIT_INVERTED  = 0x8E19;
+	QUERY_BY_REGION_NO_WAIT_INVERTED = 0x8E1A;
+	MAX_CULL_DISTANCES             = 0x82F9;
+	MAX_COMBINED_CLIP_AND_CULL_DISTANCES = 0x82FA;
+	TEXTURE_TARGET                 = 0x1006;
+	QUERY_TARGET                   = 0x82EA;
+	GUILTY_CONTEXT_RESET           = 0x8253;
+	INNOCENT_CONTEXT_RESET         = 0x8254;
+	UNKNOWN_CONTEXT_RESET          = 0x8255;
+	RESET_NOTIFICATION_STRATEGY    = 0x8256;
+	LOSE_CONTEXT_ON_RESET          = 0x8252;
+	NO_RESET_NOTIFICATION          = 0x8261;
+	CONTEXT_FLAG_ROBUST_ACCESS_BIT = 0x00000004;
+	CONTEXT_RELEASE_BEHAVIOR       = 0x82FB;
+	CONTEXT_RELEASE_BEHAVIOR_FLUSH = 0x82FC;
 
+	DEBUG_OUTPUT_SYNCHRONOUS_ARB   = 0x8242;
+	DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB = 0x8243;
+	DEBUG_CALLBACK_FUNCTION_ARB    = 0x8244;
+	DEBUG_CALLBACK_USER_PARAM_ARB  = 0x8245;
+	DEBUG_SOURCE_API_ARB           = 0x8246;
+	DEBUG_SOURCE_WINDOW_SYSTEM_ARB = 0x8247;
+	DEBUG_SOURCE_SHADER_COMPILER_ARB = 0x8248;
+	DEBUG_SOURCE_THIRD_PARTY_ARB   = 0x8249;
+	DEBUG_SOURCE_APPLICATION_ARB   = 0x824A;
+	DEBUG_SOURCE_OTHER_ARB         = 0x824B;
+	DEBUG_TYPE_ERROR_ARB           = 0x824C;
+	DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB = 0x824D;
+	DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB = 0x824E;
+	DEBUG_TYPE_PORTABILITY_ARB     = 0x824F;
+	DEBUG_TYPE_PERFORMANCE_ARB     = 0x8250;
+	DEBUG_TYPE_OTHER_ARB           = 0x8251;
+	MAX_DEBUG_MESSAGE_LENGTH_ARB   = 0x9143;
+	MAX_DEBUG_LOGGED_MESSAGES_ARB  = 0x9144;
+	DEBUG_LOGGED_MESSAGES_ARB      = 0x9145;
+	DEBUG_SEVERITY_HIGH_ARB        = 0x9146;
+	DEBUG_SEVERITY_MEDIUM_ARB      = 0x9147;
+	DEBUG_SEVERITY_LOW_ARB         = 0x9148;
+)

+ 5 - 3
core/os.odin

@@ -1,6 +1,8 @@
-import_load "os_windows.odin" when ODIN_OS == "windows";
-import_load "os_x.odin"       when ODIN_OS == "osx";
-import_load "os_linux.odin"   when ODIN_OS == "linux";
+import_load (
+	"os_windows.odin" when ODIN_OS == "windows";
+	"os_x.odin"       when ODIN_OS == "osx";
+	"os_linux.odin"   when ODIN_OS == "linux";
+)
 
 proc write_string(fd: Handle, str: string) -> (int, Errno) {
 	return write(fd, []u8(str));

+ 79 - 77
core/os_linux.odin

@@ -1,36 +1,40 @@
+#foreign_system_library dl   "dl";
+#foreign_system_library libc "c";
 import "strings.odin";
 
-type Handle   i32;
-type FileTime u64;
-type Errno    i32;
-
-// INVALID_HANDLE: Handle : -1;
-
-const O_RDONLY   = 0x00000;
-const O_WRONLY   = 0x00001;
-const O_RDWR     = 0x00002;
-const O_CREAT    = 0x00040;
-const O_EXCL     = 0x00080;
-const O_NOCTTY   = 0x00100;
-const O_TRUNC    = 0x00200;
-const O_NONBLOCK = 0x00800;
-const O_APPEND   = 0x00400;
-const O_SYNC     = 0x01000;
-const O_ASYNC    = 0x02000;
-const O_CLOEXEC  = 0x80000;
-const SEEK_SET   = 0;
-const SEEK_CUR   = 1;
-const SEEK_END   = 2;
-const SEEK_DATA  = 3;
-const SEEK_HOLE  = 4;
-const SEEK_MAX   = SEEK_HOLE;
-
-// NOTE(zangent): These are OS specific!
-// Do not mix these up!
-const RTLD_LAZY         = 0x001;
-const RTLD_NOW          = 0x002;
-const RTLD_BINDING_MASK = 0x3;
-const RTLD_GLOBAL       = 0x100;
+type (
+	Handle   i32;
+	FileTime u64;
+	Errno    i32;
+)
+
+const (
+	O_RDONLY   = 0x00000;
+	O_WRONLY   = 0x00001;
+	O_RDWR     = 0x00002;
+	O_CREAT    = 0x00040;
+	O_EXCL     = 0x00080;
+	O_NOCTTY   = 0x00100;
+	O_TRUNC    = 0x00200;
+	O_NONBLOCK = 0x00800;
+	O_APPEND   = 0x00400;
+	O_SYNC     = 0x01000;
+	O_ASYNC    = 0x02000;
+	O_CLOEXEC  = 0x80000;
+	SEEK_SET   = 0;
+	SEEK_CUR   = 1;
+	SEEK_END   = 2;
+	SEEK_DATA  = 3;
+	SEEK_HOLE  = 4;
+	SEEK_MAX   = SEEK_HOLE;
+
+	// NOTE(zangent): These are OS specific!
+	// Do not mix these up!
+	RTLD_LAZY         = 0x001;
+	RTLD_NOW          = 0x002;
+	RTLD_BINDING_MASK = 0x3;
+	RTLD_GLOBAL       = 0x100;
+)
 
 // "Argv" arguments converted to Odin strings
 let args = _alloc_command_line_arguments();
@@ -70,41 +74,39 @@ type Stat struct #ordered {
 };
 
 // File type
-
-const S_IFMT   = 0170000; // Type of file mask
-const S_IFIFO  = 0010000; // Named pipe (fifo)
-const S_IFCHR  = 0020000; // Character special
-const S_IFDIR  = 0040000; // Directory
-const S_IFBLK  = 0060000; // Block special
-const S_IFREG  = 0100000; // Regular
-const S_IFLNK  = 0120000; // Symbolic link
-const S_IFSOCK = 0140000; // Socket
-
-// File mode
-// Read, write, execute/search by owner
-
-const S_IRWXU = 0000700; // RWX mask for owner
-const S_IRUSR = 0000400; // R for owner
-const S_IWUSR = 0000200; // W for owner
-const S_IXUSR = 0000100; // X for owner
-
-// Read, write, execute/search by group
-
-const S_IRWXG = 0000070; // RWX mask for group
-const S_IRGRP = 0000040; // R for group
-const S_IWGRP = 0000020; // W for group
-const S_IXGRP = 0000010; // X for group
-
-// Read, write, execute/search by others
-
-const S_IRWXO = 0000007; // RWX mask for other
-const S_IROTH = 0000004; // R for other
-const S_IWOTH = 0000002; // W for other
-const S_IXOTH = 0000001; // X for other
-
-const S_ISUID = 0004000; // Set user id on execution
-const S_ISGID = 0002000; // Set group id on execution
-const S_ISVTX = 0001000; // Directory restrcted delete
+const (
+	S_IFMT   = 0170000; // Type of file mask
+	S_IFIFO  = 0010000; // Named pipe (fifo)
+	S_IFCHR  = 0020000; // Character special
+	S_IFDIR  = 0040000; // Directory
+	S_IFBLK  = 0060000; // Block special
+	S_IFREG  = 0100000; // Regular
+	S_IFLNK  = 0120000; // Symbolic link
+	S_IFSOCK = 0140000; // Socket
+
+	// File mode
+	// Read, write, execute/search by owner
+	S_IRWXU = 0000700; // RWX mask for owner
+	S_IRUSR = 0000400; // R for owner
+	S_IWUSR = 0000200; // W for owner
+	S_IXUSR = 0000100; // X for owner
+
+	// Read, write, execute/search by group
+	S_IRWXG = 0000070; // RWX mask for group
+	S_IRGRP = 0000040; // R for group
+	S_IWGRP = 0000020; // W for group
+	S_IXGRP = 0000010; // X for group
+
+	// Read, write, execute/search by others
+	S_IRWXO = 0000007; // RWX mask for other
+	S_IROTH = 0000004; // R for other
+	S_IWOTH = 0000002; // W for other
+	S_IXOTH = 0000001; // X for other
+
+	S_ISUID = 0004000; // Set user id on execution
+	S_ISGID = 0002000; // Set group id on execution
+	S_ISVTX = 0001000; // Directory restrcted delete
+)
 
 proc S_ISLNK (m: u32) -> bool #inline  {return (m & S_IFMT) == S_IFLNK; }
 proc S_ISREG (m: u32) -> bool #inline  {return (m & S_IFMT) == S_IFREG; }
@@ -114,13 +116,12 @@ proc S_ISBLK (m: u32) -> bool #inline  {return (m & S_IFMT) == S_IFBLK; }
 proc S_ISFIFO(m: u32) -> bool #inline  {return (m & S_IFMT) == S_IFIFO; }
 proc S_ISSOCK(m: u32) -> bool #inline  {return (m & S_IFMT) == S_IFSOCK;}
 
-const R_OK = 4; // Test for read permission
-const W_OK = 2; // Test for write permission
-const X_OK = 1; // Test for execute permission
-const F_OK = 0; // Test for file existance
-
-#foreign_system_library dl   "dl";
-#foreign_system_library libc "c";
+const (
+	R_OK = 4; // Test for read permission
+	W_OK = 2; // Test for write permission
+	X_OK = 1; // Test for execute permission
+	F_OK = 0; // Test for file existance
+)
 
 proc _unix_open  (path: ^u8, mode: int) -> Handle                               #foreign libc "open";
 proc _unix_close (fd: Handle) -> i32                                            #foreign libc "close";
@@ -187,10 +188,11 @@ proc file_size(fd: Handle) -> (i64, Errno) {
 
 
 // NOTE(bill): Uses startup to initialize it
-var stdin:  Handle = 0;
-var stdout: Handle = 1;
-var stderr: Handle = 2;
-
+var (
+	stdin:  Handle = 0;
+	stdout: Handle = 1;
+	stderr: Handle = 2;
+)
 /* TODO(zangent): Implement these!
 proc last_write_time(fd: Handle) -> FileTime {}
 proc last_write_time_by_name(name: string) -> FileTime {}

+ 49 - 47
core/os_windows.odin

@@ -1,52 +1,54 @@
 import win32 "sys/windows.odin";
 
-type Handle   int;
-type FileTime u64;
-type Errno    int;
-
-const INVALID_HANDLE: Handle = -1;
-
-
-const O_RDONLY   = 0x00000;
-const O_WRONLY   = 0x00001;
-const O_RDWR     = 0x00002;
-const O_CREAT    = 0x00040;
-const O_EXCL     = 0x00080;
-const O_NOCTTY   = 0x00100;
-const O_TRUNC    = 0x00200;
-const O_NONBLOCK = 0x00800;
-const O_APPEND   = 0x00400;
-const O_SYNC     = 0x01000;
-const O_ASYNC    = 0x02000;
-const O_CLOEXEC  = 0x80000;
-
-const ERROR_NONE:                Errno = 0;
-const ERROR_FILE_NOT_FOUND:      Errno = 2;
-const ERROR_PATH_NOT_FOUND:      Errno = 3;
-const ERROR_ACCESS_DENIED:       Errno = 5;
-const ERROR_NO_MORE_FILES:       Errno = 18;
-const ERROR_HANDLE_EOF:          Errno = 38;
-const ERROR_NETNAME_DELETED:     Errno = 64;
-const ERROR_FILE_EXISTS:         Errno = 80;
-const ERROR_BROKEN_PIPE:         Errno = 109;
-const ERROR_BUFFER_OVERFLOW:     Errno = 111;
-const ERROR_INSUFFICIENT_BUFFER: Errno = 122;
-const ERROR_MOD_NOT_FOUND:       Errno = 126;
-const ERROR_PROC_NOT_FOUND:      Errno = 127;
-const ERROR_DIR_NOT_EMPTY:       Errno = 145;
-const ERROR_ALREADY_EXISTS:      Errno = 183;
-const ERROR_ENVVAR_NOT_FOUND:    Errno = 203;
-const ERROR_MORE_DATA:           Errno = 234;
-const ERROR_OPERATION_ABORTED:   Errno = 995;
-const ERROR_IO_PENDING:          Errno = 997;
-const ERROR_NOT_FOUND:           Errno = 1168;
-const ERROR_PRIVILEGE_NOT_HELD:  Errno = 1314;
-const WSAEACCES:                 Errno = 10013;
-const WSAECONNRESET:             Errno = 10054;
-
-// Windows reserves errors >= 1<<29 for application use
-const ERROR_FILE_IS_PIPE: Errno = 1<<29 + 0;
-
+type (
+	Handle   int;
+	FileTime u64;
+	Errno    int;
+)
+
+const (
+	INVALID_HANDLE: Handle = -1;
+
+	O_RDONLY   = 0x00000;
+	O_WRONLY   = 0x00001;
+	O_RDWR     = 0x00002;
+	O_CREAT    = 0x00040;
+	O_EXCL     = 0x00080;
+	O_NOCTTY   = 0x00100;
+	O_TRUNC    = 0x00200;
+	O_NONBLOCK = 0x00800;
+	O_APPEND   = 0x00400;
+	O_SYNC     = 0x01000;
+	O_ASYNC    = 0x02000;
+	O_CLOEXEC  = 0x80000;
+
+	ERROR_NONE:                Errno = 0;
+	ERROR_FILE_NOT_FOUND:      Errno = 2;
+	ERROR_PATH_NOT_FOUND:      Errno = 3;
+	ERROR_ACCESS_DENIED:       Errno = 5;
+	ERROR_NO_MORE_FILES:       Errno = 18;
+	ERROR_HANDLE_EOF:          Errno = 38;
+	ERROR_NETNAME_DELETED:     Errno = 64;
+	ERROR_FILE_EXISTS:         Errno = 80;
+	ERROR_BROKEN_PIPE:         Errno = 109;
+	ERROR_BUFFER_OVERFLOW:     Errno = 111;
+	ERROR_INSUFFICIENT_BUFFER: Errno = 122;
+	ERROR_MOD_NOT_FOUND:       Errno = 126;
+	ERROR_PROC_NOT_FOUND:      Errno = 127;
+	ERROR_DIR_NOT_EMPTY:       Errno = 145;
+	ERROR_ALREADY_EXISTS:      Errno = 183;
+	ERROR_ENVVAR_NOT_FOUND:    Errno = 203;
+	ERROR_MORE_DATA:           Errno = 234;
+	ERROR_OPERATION_ABORTED:   Errno = 995;
+	ERROR_IO_PENDING:          Errno = 997;
+	ERROR_NOT_FOUND:           Errno = 1168;
+	ERROR_PRIVILEGE_NOT_HELD:  Errno = 1314;
+	WSAEACCES:                 Errno = 10013;
+	WSAECONNRESET:             Errno = 10054;
+
+	// Windows reserves errors >= 1<<29 for application use
+	ERROR_FILE_IS_PIPE: Errno = 1<<29 + 0;
+)
 
 // "Argv" arguments converted to Odin strings
 let args = _alloc_command_line_arguments();

+ 84 - 83
core/os_x.odin

@@ -1,43 +1,46 @@
+#foreign_system_library dl   "dl";
+#foreign_system_library libc "c";
 import "fmt.odin";
 import "strings.odin";
 
-type Handle    i32;
-type FileTime  u64;
-type Errno     int;
-
-// TODO(zangent): Find out how to make this work on x64 and x32.
-type AddressSize i64;
-
-// INVALID_HANDLE: Handle : -1;
-
-const O_RDONLY   = 0x00000;
-const O_WRONLY   = 0x00001;
-const O_RDWR     = 0x00002;
-const O_CREAT    = 0x00040;
-const O_EXCL     = 0x00080;
-const O_NOCTTY   = 0x00100;
-const O_TRUNC    = 0x00200;
-const O_NONBLOCK = 0x00800;
-const O_APPEND   = 0x00400;
-const O_SYNC     = 0x01000;
-const O_ASYNC    = 0x02000;
-const O_CLOEXEC  = 0x80000;
-const SEEK_SET   = 0;
-const SEEK_CUR   = 1;
-const SEEK_END   = 2;
-const SEEK_DATA  = 3;
-const SEEK_HOLE  = 4;
-const SEEK_MAX   = SEEK_HOLE;
-
-// NOTE(zangent): These are OS specific!
-// Do not mix these up!
-const RTLD_LAZY     = 0x1;
-const RTLD_NOW      = 0x2;
-const RTLD_LOCAL    = 0x4;
-const RTLD_GLOBAL   = 0x8;
-const RTLD_NODELETE = 0x80;
-const RTLD_NOLOAD   = 0x10;
-const RTLD_FIRST    = 0x100;
+type (
+	Handle    i32;
+	FileTime  u64;
+	Errno     int;
+
+	AddressSize int;
+)
+
+const (
+	O_RDONLY   = 0x00000;
+	O_WRONLY   = 0x00001;
+	O_RDWR     = 0x00002;
+	O_CREAT    = 0x00040;
+	O_EXCL     = 0x00080;
+	O_NOCTTY   = 0x00100;
+	O_TRUNC    = 0x00200;
+	O_NONBLOCK = 0x00800;
+	O_APPEND   = 0x00400;
+	O_SYNC     = 0x01000;
+	O_ASYNC    = 0x02000;
+	O_CLOEXEC  = 0x80000;
+	SEEK_SET   = 0;
+	SEEK_CUR   = 1;
+	SEEK_END   = 2;
+	SEEK_DATA  = 3;
+	SEEK_HOLE  = 4;
+	SEEK_MAX   = SEEK_HOLE;
+
+	// NOTE(zangent): These are OS specific!
+	// Do not mix these up!
+	RTLD_LAZY     = 0x1;
+	RTLD_NOW      = 0x2;
+	RTLD_LOCAL    = 0x4;
+	RTLD_GLOBAL   = 0x8;
+	RTLD_NODELETE = 0x80;
+	RTLD_NOLOAD   = 0x10;
+	RTLD_FIRST    = 0x100;
+)
 
 var args: [dynamic]string;
 
@@ -71,41 +74,39 @@ type Stat struct #ordered {
 };
 
 // File type
-
-const S_IFMT   = 0170000; // Type of file mask
-const S_IFIFO  = 0010000; // Named pipe (fifo)
-const S_IFCHR  = 0020000; // Character special
-const S_IFDIR  = 0040000; // Directory
-const S_IFBLK  = 0060000; // Block special
-const S_IFREG  = 0100000; // Regular
-const S_IFLNK  = 0120000; // Symbolic link
-const S_IFSOCK = 0140000; // Socket
-
-// File mode
-// Read, write, execute/search by owner
-
-const S_IRWXU = 0000700; // RWX mask for owner
-const S_IRUSR = 0000400; // R for owner
-const S_IWUSR = 0000200; // W for owner
-const S_IXUSR = 0000100; // X for owner
-
-// Read, write, execute/search by group
-
-const S_IRWXG = 0000070; // RWX mask for group
-const S_IRGRP = 0000040; // R for group
-const S_IWGRP = 0000020; // W for group
-const S_IXGRP = 0000010; // X for group
-
-// Read, write, execute/search by others
-
-const S_IRWXO = 0000007; // RWX mask for other
-const S_IROTH = 0000004; // R for other
-const S_IWOTH = 0000002; // W for other
-const S_IXOTH = 0000001; // X for other
-
-const S_ISUID = 0004000; // Set user id on execution
-const S_ISGID = 0002000; // Set group id on execution
-const S_ISVTX = 0001000; // Directory restrcted delete
+const (
+	S_IFMT   = 0170000; // Type of file mask
+	S_IFIFO  = 0010000; // Named pipe (fifo)
+	S_IFCHR  = 0020000; // Character special
+	S_IFDIR  = 0040000; // Directory
+	S_IFBLK  = 0060000; // Block special
+	S_IFREG  = 0100000; // Regular
+	S_IFLNK  = 0120000; // Symbolic link
+	S_IFSOCK = 0140000; // Socket
+
+	// File mode
+	// Read, write, execute/search by owner
+	S_IRWXU = 0000700; // RWX mask for owner
+	S_IRUSR = 0000400; // R for owner
+	S_IWUSR = 0000200; // W for owner
+	S_IXUSR = 0000100; // X for owner
+
+	// Read, write, execute/search by group
+	S_IRWXG = 0000070; // RWX mask for group
+	S_IRGRP = 0000040; // R for group
+	S_IWGRP = 0000020; // W for group
+	S_IXGRP = 0000010; // X for group
+
+	// Read, write, execute/search by others
+	S_IRWXO = 0000007; // RWX mask for other
+	S_IROTH = 0000004; // R for other
+	S_IWOTH = 0000002; // W for other
+	S_IXOTH = 0000001; // X for other
+
+	S_ISUID = 0004000; // Set user id on execution
+	S_ISGID = 0002000; // Set group id on execution
+	S_ISVTX = 0001000; // Directory restrcted delete
+)
 
 proc S_ISLNK (m: u32) -> bool #inline  {return (m & S_IFMT) == S_IFLNK; }
 proc S_ISREG (m: u32) -> bool #inline  {return (m & S_IFMT) == S_IFREG; }
@@ -115,13 +116,12 @@ proc S_ISBLK (m: u32) -> bool #inline  {return (m & S_IFMT) == S_IFBLK; }
 proc S_ISFIFO(m: u32) -> bool #inline  {return (m & S_IFMT) == S_IFIFO; }
 proc S_ISSOCK(m: u32) -> bool #inline  {return (m & S_IFMT) == S_IFSOCK;}
 
-const R_OK = 4; // Test for read permission
-const W_OK = 2; // Test for write permission
-const X_OK = 1; // Test for execute permission
-const F_OK = 0; // Test for file existance
-
-#foreign_system_library dl   "dl";
-#foreign_system_library libc "c";
+const (
+	R_OK = 4; // Test for read permission
+	W_OK = 2; // Test for write permission
+	X_OK = 1; // Test for execute permission
+	F_OK = 0; // Test for file existance
+)
 
 proc unix_open  (path: ^u8, mode: int) -> Handle                               #foreign libc "open";
 proc unix_close (handle: Handle)                                               #foreign libc "close";
@@ -206,10 +206,11 @@ proc file_size(fd: Handle) -> (i64, Errno) {
 
 
 // NOTE(bill): Uses startup to initialize it
-var stdin:  Handle = 0; // get_std_handle(win32.STD_INPUT_HANDLE);
-var stdout: Handle = 1; // get_std_handle(win32.STD_OUTPUT_HANDLE);
-var stderr: Handle = 2; // get_std_handle(win32.STD_ERROR_HANDLE);
-
+var (
+	stdin:  Handle = 0; // get_std_handle(win32.STD_INPUT_HANDLE);
+	stdout: Handle = 1; // get_std_handle(win32.STD_OUTPUT_HANDLE);
+	stderr: Handle = 2; // get_std_handle(win32.STD_ERROR_HANDLE);
+)
 /* TODO(zangent): Implement these!
 proc last_write_time(fd: Handle) -> FileTime {}
 proc last_write_time_by_name(name: string) -> FileTime {}

+ 25 - 23
core/raw.odin

@@ -1,27 +1,29 @@
-type Any struct #ordered {
-	data:      rawptr,
-	type_info: ^TypeInfo,
-};
+type (
+	Any struct #ordered {
+		data:      rawptr,
+		type_info: ^TypeInfo,
+	};
 
-type String struct #ordered {
-	data: ^u8,
-	len:  int,
-};
+	String struct #ordered {
+		data: ^u8,
+		len:  int,
+	};
 
-type Slice struct #ordered {
-	data: rawptr,
-	len:  int,
-	cap:  int,
-};
+	Slice struct #ordered {
+		data: rawptr,
+		len:  int,
+		cap:  int,
+	};
 
-type DynamicArray struct #ordered {
-	data:      rawptr,
-	len:       int,
-	cap:       int,
-	allocator: Allocator,
-};
+	DynamicArray struct #ordered {
+		data:      rawptr,
+		len:       int,
+		cap:       int,
+		allocator: Allocator,
+	};
 
-type DynamicMap struct #ordered {
-	hashes:  [dynamic]int,
-	entries: DynamicArray,
-};
+	DynamicMap struct #ordered {
+		hashes:  [dynamic]int,
+		entries: DynamicArray,
+	};
+)

+ 4 - 2
core/sync.odin

@@ -1,2 +1,4 @@
-import_load "sync_windows.odin" when ODIN_OS == "windows";
-import_load "sync_linux.odin"   when ODIN_OS == "linux";
+import_load (
+	"sync_windows.odin" when ODIN_OS == "windows";
+	"sync_linux.odin"   when ODIN_OS == "linux";
+)

+ 4 - 2
core/sync_linux.odin

@@ -1,5 +1,7 @@
-import "atomics.odin";
-import "os.odin";
+import (
+	"atomics.odin";
+	"os.odin";
+)
 
 type Semaphore struct {
 	// _handle: win32.Handle,

+ 4 - 2
core/sync_windows.odin

@@ -1,5 +1,7 @@
-import win32 "sys/windows.odin" when ODIN_OS == "windows";
-import "atomics.odin";
+import (
+	win32 "sys/windows.odin" when ODIN_OS == "windows";
+	"atomics.odin";
+)
 
 type Semaphore struct {
 	_handle: win32.Handle,

+ 9 - 8
core/utf16.odin

@@ -1,11 +1,12 @@
-const REPLACEMENT_CHAR = '\uFFFD';
-const MAX_RUNE         = '\U0010FFFF';
-
-const _surr1           = 0xd800;
-const _surr2           = 0xdc00;
-const _surr3           = 0xe000;
-const _surr_self       = 0x10000;
-
+const (
+	REPLACEMENT_CHAR = '\uFFFD';
+	MAX_RUNE         = '\U0010FFFF';
+
+	_surr1           = 0xd800;
+	_surr2           = 0xdc00;
+	_surr3           = 0xe000;
+	_surr_self       = 0x10000;
+)
 
 proc is_surrogate(r: rune) -> bool {
 	return _surr1 <= r && r < _surr3;

+ 60 - 56
core/utf8.odin

@@ -1,62 +1,66 @@
-const RUNE_ERROR = '\ufffd';
-const RUNE_SELF  = 0x80;
-const RUNE_BOM   = 0xfeff;
-const RUNE_EOF   = ~rune(0);
-const MAX_RUNE   = '\U0010ffff';
-const UTF_MAX    = 4;
-
-const SURROGATE_MIN = 0xd800;
-const SURROGATE_MAX = 0xdfff;
-
-const T1 = 0b0000_0000;
-const TX = 0b1000_0000;
-const T2 = 0b1100_0000;
-const T3 = 0b1110_0000;
-const T4 = 0b1111_0000;
-const T5 = 0b1111_1000;
-
-const MASKX = 0b0011_1111;
-const MASK2 = 0b0001_1111;
-const MASK3 = 0b0000_1111;
-const MASK4 = 0b0000_0111;
-
-const RUNE1_MAX = 1<<7 - 1;
-const RUNE2_MAX = 1<<11 - 1;
-const RUNE3_MAX = 1<<16 - 1;
-
-// The default lowest and highest continuation byte.
-const LOCB = 0b1000_0000;
-const HICB = 0b1011_1111;
+const (
+	RUNE_ERROR = '\ufffd';
+	RUNE_SELF  = 0x80;
+	RUNE_BOM   = 0xfeff;
+	RUNE_EOF   = ~rune(0);
+	MAX_RUNE   = '\U0010ffff';
+	UTF_MAX    = 4;
+
+	SURROGATE_MIN = 0xd800;
+	SURROGATE_MAX = 0xdfff;
+
+	T1 = 0b0000_0000;
+	TX = 0b1000_0000;
+	T2 = 0b1100_0000;
+	T3 = 0b1110_0000;
+	T4 = 0b1111_0000;
+	T5 = 0b1111_1000;
+
+	MASKX = 0b0011_1111;
+	MASK2 = 0b0001_1111;
+	MASK3 = 0b0000_1111;
+	MASK4 = 0b0000_0111;
+
+	RUNE1_MAX = 1<<7 - 1;
+	RUNE2_MAX = 1<<11 - 1;
+	RUNE3_MAX = 1<<16 - 1;
+
+	// The default lowest and highest continuation byte.
+	LOCB = 0b1000_0000;
+	HICB = 0b1011_1111;
+)
 
 type AcceptRange struct { lo, hi: u8 }
 
-let accept_ranges = [5]AcceptRange{
-	{0x80, 0xbf},
-	{0xa0, 0xbf},
-	{0x80, 0x9f},
-	{0x90, 0xbf},
-	{0x80, 0x8f},
-};
-
-let accept_sizes = [256]u8{
-	0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, // 0x00-0x0f
-	0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, // 0x10-0x1f
-	0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, // 0x20-0x2f
-	0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, // 0x30-0x3f
-	0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, // 0x40-0x4f
-	0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, // 0x50-0x5f
-	0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, // 0x60-0x6f
-	0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, // 0x70-0x7f
-
-	0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, // 0x80-0x8f
-	0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, // 0x90-0x9f
-	0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, // 0xa0-0xaf
-	0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, // 0xb0-0xbf
-	0xf1, 0xf1, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, // 0xc0-0xcf
-	0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, // 0xd0-0xdf
-	0x13, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x23, 0x03, 0x03, // 0xe0-0xef
-	0x34, 0x04, 0x04, 0x04, 0x44, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, // 0xf0-0xff
-};
+let (
+	accept_ranges = [5]AcceptRange{
+		{0x80, 0xbf},
+		{0xa0, 0xbf},
+		{0x80, 0x9f},
+		{0x90, 0xbf},
+		{0x80, 0x8f},
+	};
+
+	accept_sizes = [256]u8{
+		0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, // 0x00-0x0f
+		0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, // 0x10-0x1f
+		0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, // 0x20-0x2f
+		0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, // 0x30-0x3f
+		0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, // 0x40-0x4f
+		0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, // 0x50-0x5f
+		0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, // 0x60-0x6f
+		0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, // 0x70-0x7f
+
+		0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, // 0x80-0x8f
+		0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, // 0x90-0x9f
+		0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, // 0xa0-0xaf
+		0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, // 0xb0-0xbf
+		0xf1, 0xf1, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, // 0xc0-0xcf
+		0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, // 0xd0-0xdf
+		0x13, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x23, 0x03, 0x03, // 0xe0-0xef
+		0x34, 0x04, 0x04, 0x04, 0x44, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, // 0xf0-0xff
+	};
+)
 
 proc encode_rune(r: rune) -> ([4]u8, int) {
 	var buf: [4]u8;

+ 100 - 95
src/check_stmt.cpp

@@ -1535,121 +1535,126 @@ void check_stmt_internal(Checker *c, AstNode *node, u32 flags) {
 		check_stmt(c, pa->body, mod_flags);
 	case_end;
 
-
-	case_ast_node(vd, ValueDecl, node);
+	case_ast_node(gd, GenDecl, node);
 		GB_ASSERT(!c->context.scope->is_file);
-		if (vd->token.kind == Token_const) {
-			// NOTE(bill): Handled elsewhere
-		} else {
-			Entity **entities = gb_alloc_array(c->allocator, Entity *, vd->names.count);
-			isize entity_count = 0;
-
-			if (vd->flags & VarDeclFlag_thread_local) {
-				vd->flags &= ~VarDeclFlag_thread_local;
-				error_node(node, "`thread_local` may only be applied to a variable declaration");
-			}
+		for_array(i, gd->specs) {
+			AstNode *spec = gd->specs[i];
+			switch (gd->token.kind) {
+			case Token_var:
+			case Token_let: {
+				ast_node(vd, ValueSpec, spec);
+
+				Entity **entities = gb_alloc_array(c->allocator, Entity *, vd->names.count);
+				isize entity_count = 0;
+
+				if (gd->flags & VarDeclFlag_thread_local) {
+					gd->flags &= ~VarDeclFlag_thread_local;
+					error_node(node, "`thread_local` may only be applied to a variable declaration");
+				}
 
-			for_array(i, vd->names) {
-				AstNode *name = vd->names[i];
-				Entity *entity = NULL;
-				if (name->kind != AstNode_Ident) {
-					error_node(name, "A variable declaration must be an identifier");
-				} else {
-					Token token = name->Ident;
-					String str = token.string;
-					Entity *found = NULL;
-					// NOTE(bill): Ignore assignments to `_`
-					if (str != "_") {
-						found = current_scope_lookup_entity(c->context.scope, str);
-					}
-					if (found == NULL) {
-						entity = make_entity_variable(c->allocator, c->context.scope, token, NULL, (vd->flags&VarDeclFlag_immutable) != 0);
-						entity->identifier = name;
+				for_array(i, vd->names) {
+					AstNode *name = vd->names[i];
+					Entity *entity = NULL;
+					if (name->kind != AstNode_Ident) {
+						error_node(name, "A variable declaration must be an identifier");
 					} else {
-						TokenPos pos = found->token.pos;
-						error(token,
-						      "Redeclaration of `%.*s` in this scope\n"
-						      "\tat %.*s(%td:%td)",
-						      LIT(str), LIT(pos.file), pos.line, pos.column);
-						entity = found;
+						Token token = name->Ident;
+						String str = token.string;
+						Entity *found = NULL;
+						// NOTE(bill): Ignore assignments to `_`
+						if (str != "_") {
+							found = current_scope_lookup_entity(c->context.scope, str);
+						}
+						if (found == NULL) {
+							entity = make_entity_variable(c->allocator, c->context.scope, token, NULL, (gd->flags&VarDeclFlag_immutable) != 0);
+							entity->identifier = name;
+						} else {
+							TokenPos pos = found->token.pos;
+							error(token,
+							      "Redeclaration of `%.*s` in this scope\n"
+							      "\tat %.*s(%td:%td)",
+							      LIT(str), LIT(pos.file), pos.line, pos.column);
+							entity = found;
+						}
 					}
+					if (entity == NULL) {
+						entity = make_entity_dummy_variable(c->allocator, c->global_scope, ast_node_token(name));
+					}
+					entity->parent_proc_decl = c->context.curr_proc_decl;
+					entities[entity_count++] = entity;
 				}
-				if (entity == NULL) {
-					entity = make_entity_dummy_variable(c->allocator, c->global_scope, ast_node_token(name));
-				}
-				entity->parent_proc_decl = c->context.curr_proc_decl;
-				entities[entity_count++] = entity;
-			}
 
-			Type *init_type = NULL;
-			if (vd->type) {
-				init_type = check_type(c, vd->type, NULL);
-				if (init_type == NULL) {
-					init_type = t_invalid;
+				Type *init_type = NULL;
+				if (vd->type) {
+					init_type = check_type(c, vd->type, NULL);
+					if (init_type == NULL) {
+						init_type = t_invalid;
+					}
 				}
-			}
 
-			for (isize i = 0; i < entity_count; i++) {
-				Entity *e = entities[i];
-				GB_ASSERT(e != NULL);
-				if (e->flags & EntityFlag_Visited) {
-					e->type = t_invalid;
-					continue;
-				}
-				e->flags |= EntityFlag_Visited;
+				for (isize i = 0; i < entity_count; i++) {
+					Entity *e = entities[i];
+					GB_ASSERT(e != NULL);
+					if (e->flags & EntityFlag_Visited) {
+						e->type = t_invalid;
+						continue;
+					}
+					e->flags |= EntityFlag_Visited;
 
-				if (e->type == NULL) {
-					e->type = init_type;
+					if (e->type == NULL) {
+						e->type = init_type;
+					}
 				}
-			}
 
-			check_arity_match(c, vd);
-			check_init_variables(c, entities, entity_count, vd->values, str_lit("variable declaration"));
+				check_arity_match(c, vd);
+				check_init_variables(c, entities, entity_count, vd->values, str_lit("variable declaration"));
 
-			for (isize i = 0; i < entity_count; i++) {
-				add_entity(c, c->context.scope, entities[i]->identifier, entities[i]);
-			}
-
-			if ((vd->flags & VarDeclFlag_using) != 0) {
-				Token token = ast_node_token(node);
-				if (vd->type != NULL && entity_count > 1) {
-					error(token, "`using` can only be applied to one variable of the same type");
-					// TODO(bill): Should a `continue` happen here?
+				for (isize i = 0; i < entity_count; i++) {
+					add_entity(c, c->context.scope, entities[i]->identifier, entities[i]);
 				}
 
-				for (isize entity_index = 0; entity_index < entity_count; entity_index++) {
-					Entity *e = entities[entity_index];
-					if (e == NULL) {
-						continue;
+				if ((gd->flags & VarDeclFlag_using) != 0) {
+					Token token = ast_node_token(node);
+					if (vd->type != NULL && entity_count > 1) {
+						error(token, "`using` can only be applied to one variable of the same type");
+						// TODO(bill): Should a `continue` happen here?
 					}
-					if (e->kind != Entity_Variable) {
-						continue;
-					}
-					bool is_immutable = e->Variable.is_immutable;
-					String name = e->token.string;
-					Type *t = base_type(type_deref(e->type));
-
-					if (is_type_struct(t) || is_type_raw_union(t)) {
-						Scope **found = map_get(&c->info.scopes, hash_pointer(t->Record.node));
-						GB_ASSERT(found != NULL);
-						for_array(i, (*found)->elements.entries) {
-							Entity *f = (*found)->elements.entries[i].value;
-							if (f->kind == Entity_Variable) {
-								Entity *uvar = make_entity_using_variable(c->allocator, e, f->token, f->type);
-								uvar->Variable.is_immutable = is_immutable;
-								Entity *prev = scope_insert_entity(c->context.scope, uvar);
-								if (prev != NULL) {
-									error(token, "Namespace collision while `using` `%.*s` of: %.*s", LIT(name), LIT(prev->token.string));
-									return;
+
+					for (isize entity_index = 0; entity_index < entity_count; entity_index++) {
+						Entity *e = entities[entity_index];
+						if (e == NULL) {
+							continue;
+						}
+						if (e->kind != Entity_Variable) {
+							continue;
+						}
+						bool is_immutable = e->Variable.is_immutable;
+						String name = e->token.string;
+						Type *t = base_type(type_deref(e->type));
+
+						if (is_type_struct(t) || is_type_raw_union(t)) {
+							Scope **found = map_get(&c->info.scopes, hash_pointer(t->Record.node));
+							GB_ASSERT(found != NULL);
+							for_array(i, (*found)->elements.entries) {
+								Entity *f = (*found)->elements.entries[i].value;
+								if (f->kind == Entity_Variable) {
+									Entity *uvar = make_entity_using_variable(c->allocator, e, f->token, f->type);
+									uvar->Variable.is_immutable = is_immutable;
+									Entity *prev = scope_insert_entity(c->context.scope, uvar);
+									if (prev != NULL) {
+										error(token, "Namespace collision while `using` `%.*s` of: %.*s", LIT(name), LIT(prev->token.string));
+										return;
+									}
 								}
 							}
+						} else {
+							// NOTE(bill): skip the rest to remove extra errors
+							error(token, "`using` can only be applied to variables of type struct or raw_union");
+							return;
 						}
-					} else {
-						// NOTE(bill): skip the rest to remove extra errors
-						error(token, "`using` can only be applied to variables of type struct or raw_union");
-						return;
 					}
 				}
+			} break;
 			}
 		}
 	case_end;

+ 150 - 133
src/checker.cpp

@@ -1249,7 +1249,7 @@ void init_preload(Checker *c) {
 
 
 
-bool check_arity_match(Checker *c, AstNodeValueDecl *d);
+bool check_arity_match(Checker *c, AstNodeValueSpec *s);
 void check_collect_entities(Checker *c, Array<AstNode *> nodes, bool is_file_scope);
 void check_collect_entities_from_when_stmt(Checker *c, AstNodeWhenStmt *ws, bool is_file_scope);
 
@@ -1362,27 +1362,27 @@ void check_procedure_overloading(Checker *c, Entity *e) {
 
 
 
-bool check_arity_match(Checker *c, AstNodeValueDecl *d) {
-	isize lhs = d->names.count;
-	isize rhs = d->values.count;
+bool check_arity_match(Checker *c, AstNodeValueSpec *spec) {
+	isize lhs = spec->names.count;
+	isize rhs = spec->values.count;
 
 	if (rhs == 0) {
-		if (d->type == NULL) {
-			error_node(d->names[0], "Missing type or initial expression");
+		if (spec->type == NULL) {
+			error_node(spec->names[0], "Missing type or initial expression");
 			return false;
 		}
 	} else if (lhs < rhs) {
-		if (lhs < d->values.count) {
-			AstNode *n = d->values[lhs];
+		if (lhs < spec->values.count) {
+			AstNode *n = spec->values[lhs];
 			gbString str = expr_to_string(n);
 			error_node(n, "Extra initial expression `%s`", str);
 			gb_string_free(str);
 		} else {
-			error_node(d->names[0], "Extra initial expression");
+			error_node(spec->names[0], "Extra initial expression");
 		}
 		return false;
 	} else if (lhs > rhs && rhs != 1) {
-		AstNode *n = d->names[rhs];
+		AstNode *n = spec->names[rhs];
 		gbString str = expr_to_string(n);
 		error_node(n, "Missing expression for `%s`", str);
 		gb_string_free(str);
@@ -1450,114 +1450,166 @@ void check_collect_entities(Checker *c, Array<AstNode *> nodes, bool is_file_sco
 			}
 		case_end;
 
-		case_ast_node(vd, ValueDecl, decl);
-			if (vd->token.kind != Token_const) {
-				if (!c->context.scope->is_file) {
-					// NOTE(bill): local scope -> handle later and in order
-					break;
-				}
-				// NOTE(bill): You need to store the entity information here unline a constant declaration
-				isize entity_cap = vd->names.count;
-				isize entity_count = 0;
-				Entity **entities = gb_alloc_array(c->allocator, Entity *, entity_cap);
-				DeclInfo *di = NULL;
-				if (vd->values.count > 0) {
-					di = make_declaration_info(heap_allocator(), c->context.scope, c->context.decl);
-					di->entities = entities;
-					di->type_expr = vd->type;
-					di->init_expr = vd->values[0];
-
-
-					if (vd->flags & VarDeclFlag_thread_local) {
-						error_node(decl, "#thread_local variable declarations cannot have initialization values");
+		case_ast_node(gd, GenDecl, decl);
+			for_array(i, gd->specs) {
+				AstNode *spec = gd->specs[i];
+				switch (gd->token.kind) {
+				case Token_var:
+				case Token_let: {
+					if (!c->context.scope->is_file) {
+						// NOTE(bill): local scope -> handle later and in order
+						break;
+					}
+					ast_node(vd, ValueSpec, spec);
+
+					// NOTE(bill): You need to store the entity information here unline a constant declaration
+					isize entity_cap = vd->names.count;
+					isize entity_count = 0;
+					Entity **entities = gb_alloc_array(c->allocator, Entity *, entity_cap);
+					DeclInfo *di = NULL;
+					if (vd->values.count > 0) {
+						di = make_declaration_info(heap_allocator(), c->context.scope, c->context.decl);
+						di->entities = entities;
+						di->type_expr = vd->type;
+						di->init_expr = vd->values[0];
+
+
+						if (gd->flags & VarDeclFlag_thread_local) {
+							error_node(decl, "#thread_local variable declarations cannot have initialization values");
+						}
 					}
-				}
 
 
-				for_array(i, vd->names) {
-					AstNode *name = vd->names[i];
-					AstNode *value = NULL;
-					if (i < vd->values.count) {
-						value = vd->values[i];
-					}
-					if (name->kind != AstNode_Ident) {
-						error_node(name, "A declaration's name must be an identifier, got %.*s", LIT(ast_node_strings[name->kind]));
-						continue;
+					for_array(i, vd->names) {
+						AstNode *name = vd->names[i];
+						AstNode *value = NULL;
+						if (i < vd->values.count) {
+							value = vd->values[i];
+						}
+						if (name->kind != AstNode_Ident) {
+							error_node(name, "A declaration's name must be an identifier, got %.*s", LIT(ast_node_strings[name->kind]));
+							continue;
+						}
+						Entity *e = make_entity_variable(c->allocator, c->context.scope, name->Ident, NULL, (gd->flags&VarDeclFlag_immutable) != 0);
+						e->Variable.is_thread_local = (gd->flags & VarDeclFlag_thread_local) != 0;
+						e->identifier = name;
+
+						if (gd->flags & VarDeclFlag_using) {
+							gd->flags &= ~VarDeclFlag_using; // NOTE(bill): This error will be only caught once
+							error_node(name, "`using` is not allowed at the file scope");
+						}
+						entities[entity_count++] = e;
+
+						DeclInfo *d = di;
+						if (d == NULL) {
+							AstNode *init_expr = value;
+							d = make_declaration_info(heap_allocator(), e->scope, c->context.decl);
+							d->type_expr = vd->type;
+							d->init_expr = init_expr;
+						}
+
+						add_entity_and_decl_info(c, name, e, d);
 					}
-					Entity *e = make_entity_variable(c->allocator, c->context.scope, name->Ident, NULL, (vd->flags&VarDeclFlag_immutable) != 0);
-					e->Variable.is_thread_local = (vd->flags & VarDeclFlag_thread_local) != 0;
-					e->identifier = name;
 
-					if (vd->flags & VarDeclFlag_using) {
-						vd->flags &= ~VarDeclFlag_using; // NOTE(bill): This error will be only caught once
-						error_node(name, "`using` is not allowed at the file scope");
+					if (di != NULL) {
+						di->entity_count = entity_count;
 					}
-					entities[entity_count++] = e;
-
-					DeclInfo *d = di;
-					if (d == NULL) {
-						AstNode *init_expr = value;
-						d = make_declaration_info(heap_allocator(), e->scope, c->context.decl);
-						d->type_expr = vd->type;
-						d->init_expr = init_expr;
+
+					check_arity_match(c, vd);
+				} break;
+
+				case Token_const: {
+					ast_node(vd, ValueSpec, spec);
+
+					for_array(i, vd->names) {
+						AstNode *name = vd->names[i];
+						if (name->kind != AstNode_Ident) {
+							error_node(name, "A declaration's name must be an identifier, got %.*s", LIT(ast_node_strings[name->kind]));
+							continue;
+						}
+
+						AstNode *init = NULL;
+						if (i < vd->values.count) {
+							init = vd->values[i];
+						}
+
+						DeclInfo *d = make_declaration_info(c->allocator, c->context.scope, c->context.decl);
+						Entity *e = NULL;
+
+						AstNode *up_init = unparen_expr(init);
+						// if (up_init != NULL && is_ast_node_type(up_init)) {
+						// 	AstNode *type = up_init;
+						// 	e = make_entity_type_name(c->allocator, d->scope, name->Ident, NULL);
+						// 	// TODO(bill): What if vd->type != NULL??? How to handle this case?
+						// 	d->type_expr = type;
+						// 	d->init_expr = type;
+						// } else if (up_init != NULL && up_init->kind == AstNode_Alias) {
+						// #if 1
+						// 	error_node(up_init, "#alias declarations are not yet supported");
+						// 	continue;
+						// #else
+						// 	e = make_entity_alias(c->allocator, d->scope, name->Ident, NULL, EntityAlias_Invalid, NULL);
+						// 	d->type_expr = vd->type;
+						// 	d->init_expr = up_init->Alias.expr;
+						// #endif
+						// // } else if (init != NULL && up_init->kind == AstNode_ProcLit) {
+						// 	// e = make_entity_procedure(c->allocator, d->scope, name->Ident, NULL, up_init->ProcLit.tags);
+						// 	// d->proc_lit = up_init;
+						// 	// d->type_expr = vd->type;
+						// } else {
+							e = make_entity_constant(c->allocator, d->scope, name->Ident, NULL, empty_exact_value);
+							d->type_expr = vd->type;
+							d->init_expr = init;
+						// }
+						GB_ASSERT(e != NULL);
+						e->identifier = name;
+
+						add_entity_and_decl_info(c, name, e, d);
 					}
 
-					add_entity_and_decl_info(c, name, e, d);
-				}
+					check_arity_match(c, vd);
+				} break;
 
-				if (di != NULL) {
-					di->entity_count = entity_count;
-				}
+				case Token_type: {
+					ast_node(td, TypeSpec, spec);
 
-				check_arity_match(c, vd);
-			} else {
-				for_array(i, vd->names) {
-					AstNode *name = vd->names[i];
+					AstNode *name = td->name;
 					if (name->kind != AstNode_Ident) {
 						error_node(name, "A declaration's name must be an identifier, got %.*s", LIT(ast_node_strings[name->kind]));
-						continue;
+						break;
 					}
 
-					AstNode *init = NULL;
-					if (i < vd->values.count) {
-						init = vd->values[i];
-					}
 
 					DeclInfo *d = make_declaration_info(c->allocator, c->context.scope, c->context.decl);
 					Entity *e = NULL;
 
-					AstNode *up_init = unparen_expr(init);
-					// if (up_init != NULL && is_ast_node_type(up_init)) {
-					// 	AstNode *type = up_init;
-					// 	e = make_entity_type_name(c->allocator, d->scope, name->Ident, NULL);
-					// 	// TODO(bill): What if vd->type != NULL??? How to handle this case?
-					// 	d->type_expr = type;
-					// 	d->init_expr = type;
-					// } else if (up_init != NULL && up_init->kind == AstNode_Alias) {
-					// #if 1
-					// 	error_node(up_init, "#alias declarations are not yet supported");
-					// 	continue;
-					// #else
-					// 	e = make_entity_alias(c->allocator, d->scope, name->Ident, NULL, EntityAlias_Invalid, NULL);
-					// 	d->type_expr = vd->type;
-					// 	d->init_expr = up_init->Alias.expr;
-					// #endif
-					// // } else if (init != NULL && up_init->kind == AstNode_ProcLit) {
-					// 	// e = make_entity_procedure(c->allocator, d->scope, name->Ident, NULL, up_init->ProcLit.tags);
-					// 	// d->proc_lit = up_init;
-					// 	// d->type_expr = vd->type;
-					// } else {
-						e = make_entity_constant(c->allocator, d->scope, name->Ident, NULL, empty_exact_value);
-						d->type_expr = vd->type;
-						d->init_expr = init;
-					// }
-					GB_ASSERT(e != NULL);
-					e->identifier = name;
+					AstNode *type = unparen_expr(td->type);
+					e = make_entity_type_name(c->allocator, d->scope, name->Ident, NULL);
+					// TODO(bill): What if vd->type != NULL??? How to handle this case?
+					d->type_expr = type;
+					d->init_expr = type;
 
+					e->identifier = name;
 					add_entity_and_decl_info(c, name, e, d);
+				} break;
+
+				case Token_import:
+				case Token_import_load: {
+					ast_node(id, ImportSpec, spec);
+					if (!c->context.scope->is_file) {
+						if (id->is_import) {
+							error_node(decl, "import declarations are only allowed in the file scope");
+						} else {
+							error_node(decl, "import_load declarations are only allowed in the file scope");
+						}
+						// NOTE(bill): _Should_ be caught by the parser
+						// TODO(bill): Better error handling if it isn't
+						continue;
+					}
+					DelayedDecl di = {c->context.scope, spec};
+					array_add(&c->delayed_imports, di);
+				} break;
 				}
-
-				check_arity_match(c, vd);
 			}
 		case_end;
 
@@ -1579,41 +1631,6 @@ void check_collect_entities(Checker *c, Array<AstNode *> nodes, bool is_file_sco
 			add_entity_and_decl_info(c, name, e, d);
 		case_end;
 
-		case_ast_node(td, TypeDecl, decl);
-			AstNode *name = td->name;
-			if (name->kind != AstNode_Ident) {
-				error_node(name, "A declaration's name must be an identifier, got %.*s", LIT(ast_node_strings[name->kind]));
-				break;
-			}
-
-
-			DeclInfo *d = make_declaration_info(c->allocator, c->context.scope, c->context.decl);
-			Entity *e = NULL;
-
-			AstNode *type = unparen_expr(td->type);
-			e = make_entity_type_name(c->allocator, d->scope, name->Ident, NULL);
-			// TODO(bill): What if vd->type != NULL??? How to handle this case?
-			d->type_expr = type;
-			d->init_expr = type;
-
-			e->identifier = name;
-			add_entity_and_decl_info(c, name, e, d);
-		case_end;
-
-		case_ast_node(id, ImportDecl, decl);
-			if (!c->context.scope->is_file) {
-				if (id->is_import) {
-					error_node(decl, "#import declarations are only allowed in the file scope");
-				} else {
-					error_node(decl, "#load declarations are only allowed in the file scope");
-				}
-				// NOTE(bill): _Should_ be caught by the parser
-				// TODO(bill): Better error handling if it isn't
-				continue;
-			}
-			DelayedDecl di = {c->context.scope, decl};
-			array_add(&c->delayed_imports, di);
-		case_end;
 		case_ast_node(fl, ForeignLibrary, decl);
 			if (!c->context.scope->is_file) {
 				if (fl->is_system) {
@@ -1882,7 +1899,7 @@ void check_import_entities(Checker *c, Map<Scope *> *file_scopes) {
 	for_array(i, c->delayed_imports) {
 		Scope *parent_scope = c->delayed_imports[i].parent;
 		AstNode *decl = c->delayed_imports[i].decl;
-		ast_node(id, ImportDecl, decl);
+		ast_node(id, ImportSpec, decl);
 		Token token = id->relpath;
 
 		GB_ASSERT(parent_scope->is_file);

+ 72 - 62
src/ir.cpp

@@ -5793,7 +5793,7 @@ void ir_build_stmt_internal(irProcedure *proc, AstNode *node) {
 	case_ast_node(us, UsingStmt, node);
 		for_array(i, us->list) {
 			AstNode *decl = unparen_expr(us->list[i]);
-			if (decl->kind == AstNode_ValueDecl) {
+			if (decl->kind == AstNode_GenDecl) {
 				ir_build_stmt(proc, decl);
 			}
 		}
@@ -5812,56 +5812,88 @@ void ir_build_stmt_internal(irProcedure *proc, AstNode *node) {
 		ir_build_assign_op(proc, addr, v_one, op);
 	case_end;
 
-	case_ast_node(vd, ValueDecl, node);
-		if (vd->token.kind != Token_const) {
-			irModule *m = proc->module;
-			gbTempArenaMemory tmp = gb_temp_arena_memory_begin(&m->tmp_arena);
+	case_ast_node(gd, GenDecl, node);
+		for_array(i, gd->specs) {
+			AstNode *spec = gd->specs[i];
+			switch (gd->token.kind) {
+			case Token_var:
+			case Token_let: {
+				ast_node(vd, ValueSpec, spec);
+
+				irModule *m = proc->module;
+				gbTempArenaMemory tmp = gb_temp_arena_memory_begin(&m->tmp_arena);
+
+				if (vd->values.count == 0) { // declared and zero-initialized
+					for_array(i, vd->names) {
+						AstNode *name = vd->names[i];
+						if (!ir_is_blank_ident(name)) {
+							ir_add_local_for_identifier(proc, name, true);
+						}
+					}
+				} else { // Tuple(s)
+					Array<irAddr> lvals = {};
+					Array<irValue *>  inits = {};
+					array_init(&lvals, m->tmp_allocator, vd->names.count);
+					array_init(&inits, m->tmp_allocator, vd->names.count);
+
+					for_array(i, vd->names) {
+						AstNode *name = vd->names[i];
+						irAddr lval = ir_addr(NULL);
+						if (!ir_is_blank_ident(name)) {
+							ir_add_local_for_identifier(proc, name, false);
+							lval = ir_build_addr(proc, name);
+						}
 
-			if (vd->values.count == 0) { // declared and zero-initialized
-				for_array(i, vd->names) {
-					AstNode *name = vd->names[i];
-					if (!ir_is_blank_ident(name)) {
-						ir_add_local_for_identifier(proc, name, true);
+						array_add(&lvals, lval);
 					}
-				}
-			} else { // Tuple(s)
-				Array<irAddr> lvals = {};
-				Array<irValue *>  inits = {};
-				array_init(&lvals, m->tmp_allocator, vd->names.count);
-				array_init(&inits, m->tmp_allocator, vd->names.count);
-
-				for_array(i, vd->names) {
-					AstNode *name = vd->names[i];
-					irAddr lval = ir_addr(NULL);
-					if (!ir_is_blank_ident(name)) {
-						ir_add_local_for_identifier(proc, name, false);
-						lval = ir_build_addr(proc, name);
+
+					for_array(i, vd->values) {
+						irValue *init = ir_build_expr(proc, vd->values[i]);
+						Type *t = ir_type(init);
+						if (t->kind == Type_Tuple) {
+							for (isize i = 0; i < t->Tuple.variable_count; i++) {
+								Entity *e = t->Tuple.variables[i];
+								irValue *v = ir_emit_struct_ev(proc, init, i);
+								array_add(&inits, v);
+							}
+						} else {
+							array_add(&inits, init);
+						}
 					}
 
-					array_add(&lvals, lval);
-				}
 
-				for_array(i, vd->values) {
-					irValue *init = ir_build_expr(proc, vd->values[i]);
-					Type *t = ir_type(init);
-					if (t->kind == Type_Tuple) {
-						for (isize i = 0; i < t->Tuple.variable_count; i++) {
-							Entity *e = t->Tuple.variables[i];
-							irValue *v = ir_emit_struct_ev(proc, init, i);
-							array_add(&inits, v);
-						}
-					} else {
-						array_add(&inits, init);
+					for_array(i, inits) {
+						ir_addr_store(proc, lvals[i], inits[i]);
 					}
 				}
 
+				gb_temp_arena_memory_end(tmp);
+			} break;
 
-				for_array(i, inits) {
-					ir_addr_store(proc, lvals[i], inits[i]);
+			case Token_type: {
+				ast_node(td, TypeSpec, node);
+
+				AstNode *ident = td->name;
+				GB_ASSERT(ident->kind == AstNode_Ident);
+				Entity *e = entity_of_ident(proc->module->info, ident);
+				GB_ASSERT(e != NULL);
+				if (e->kind == Entity_TypeName) {
+					// NOTE(bill): Generate a new name
+					// parent_proc.name-guid
+					String ts_name = e->token.string;
+					isize name_len = proc->name.len + 1 + ts_name.len + 1 + 10 + 1;
+					u8 *name_text = gb_alloc_array(proc->module->allocator, u8, name_len);
+					i32 guid = cast(i32)proc->module->members.entries.count;
+					name_len = gb_snprintf(cast(char *)name_text, name_len, "%.*s.%.*s-%d", LIT(proc->name), LIT(ts_name), guid);
+					String name = make_string(name_text, name_len-1);
+
+					irValue *value = ir_value_type_name(proc->module->allocator,
+					                                           name, e->type);
+					map_set(&proc->module->entity_names, hash_pointer(e), name);
+					ir_gen_global_type_name(proc->module, e, name);
 				}
+			} break;
 			}
-
-			gb_temp_arena_memory_end(tmp);
 		}
 	case_end;
 
@@ -5936,28 +5968,6 @@ void ir_build_stmt_internal(irProcedure *proc, AstNode *node) {
 		}
 	case_end;
 
-	case_ast_node(td, TypeDecl, node);
-		AstNode *ident = td->name;
-		GB_ASSERT(ident->kind == AstNode_Ident);
-		Entity *e = entity_of_ident(proc->module->info, ident);
-		GB_ASSERT(e != NULL);
-		if (e->kind == Entity_TypeName) {
-			// NOTE(bill): Generate a new name
-			// parent_proc.name-guid
-			String ts_name = e->token.string;
-			isize name_len = proc->name.len + 1 + ts_name.len + 1 + 10 + 1;
-			u8 *name_text = gb_alloc_array(proc->module->allocator, u8, name_len);
-			i32 guid = cast(i32)proc->module->members.entries.count;
-			name_len = gb_snprintf(cast(char *)name_text, name_len, "%.*s.%.*s-%d", LIT(proc->name), LIT(ts_name), guid);
-			String name = make_string(name_text, name_len-1);
-
-			irValue *value = ir_value_type_name(proc->module->allocator,
-			                                           name, e->type);
-			map_set(&proc->module->entity_names, hash_pointer(e), name);
-			ir_gen_global_type_name(proc->module, e, name);
-		}
-	case_end;
-
 	case_ast_node(as, AssignStmt, node);
 		ir_emit_comment(proc, str_lit("AssignStmt"));
 

+ 319 - 216
src/parser.cpp

@@ -297,13 +297,6 @@ AST_NODE_KIND(_ComplexStmtEnd, "", i32) \
 AST_NODE_KIND(_StmtEnd,        "", i32) \
 AST_NODE_KIND(_DeclBegin,      "", i32) \
 	AST_NODE_KIND(BadDecl,     "bad declaration",     struct { Token begin, end; }) \
-	AST_NODE_KIND(ValueDecl, "value declaration", struct { \
-		Token            token; \
-		Array<AstNode *> names;  \
-		AstNode *        type;   \
-		Array<AstNode *> values; \
-		u32              flags;  \
-	}) \
 	AST_NODE_KIND(ProcDecl, "procedure declaration", struct { \
 		Token    token;           \
 		AstNode *name;            \
@@ -314,20 +307,6 @@ AST_NODE_KIND(_DeclBegin,      "", i32) \
 		String   foreign_name;    \
 		String   link_name;       \
 	}) \
-	AST_NODE_KIND(TypeDecl, "type declaration", struct { \
-		Token    token; \
-		AstNode *name;  \
-		AstNode *type;  \
-	}) \
-	AST_NODE_KIND(ImportDecl, "import declaration", struct { \
-		Token     token;        \
-		bool      is_import;    \
-		Token     relpath;      \
-		String    fullpath;     \
-		Token     import_name;  \
-		AstNode   *cond;        \
-		AstNode   *note;        \
-	}) \
 	AST_NODE_KIND(ForeignLibrary, "foreign library", struct { \
 		Token token, filepath; \
 		Token library_name;     \
@@ -339,6 +318,29 @@ AST_NODE_KIND(_DeclBegin,      "", i32) \
 		Token token; \
 		AstNode *name; \
 	}) \
+	AST_NODE_KIND(GenDecl, "generic declaration", struct { \
+		Token            token; \
+		Token            open;  \
+		Token            close; \
+		Array<AstNode *> specs; \
+		u64              flags; \
+	}) \
+	AST_NODE_KIND(ValueSpec, "value specification", struct { \
+		Array<AstNode *> names;  \
+		AstNode *        type;   \
+		Array<AstNode *> values; \
+	}) \
+	AST_NODE_KIND(TypeSpec, "type specification", struct { \
+		AstNode *name;  \
+		AstNode *type;  \
+	}) \
+	AST_NODE_KIND(ImportSpec, "import specification", struct { \
+		bool     is_import;   \
+		Token    relpath;     \
+		String   fullpath;    \
+		Token    import_name; \
+		AstNode *cond;        \
+	}) \
 AST_NODE_KIND(_DeclEnd,   "", i32) \
 	AST_NODE_KIND(Field, "field", struct { \
 		Array<AstNode *> names;            \
@@ -540,12 +542,15 @@ Token ast_node_token(AstNode *node) {
 	case AstNode_PushContext:   return node->PushContext.token;
 
 	case AstNode_BadDecl:        return node->BadDecl.begin;
-	case AstNode_ValueDecl:      return node->ValueDecl.token;
 	case AstNode_ProcDecl:       return node->ProcDecl.token;
-	case AstNode_ImportDecl:     return node->ImportDecl.token;
 	case AstNode_ForeignLibrary: return node->ForeignLibrary.token;
 	case AstNode_Label:          return node->Label.token;
 
+	case AstNode_GenDecl:        return node->GenDecl.token;
+	case AstNode_ValueSpec:      return ast_node_token(node->ValueSpec.names[0]);
+	case AstNode_ImportSpec:     return node->ImportSpec.import_name;
+	case AstNode_TypeSpec:       return ast_node_token(node->TypeSpec.name);
+
 
 	case AstNode_Field:
 		if (node->Field.names.count > 0) {
@@ -761,15 +766,6 @@ AstNode *clone_ast_node(gbAllocator a, AstNode *node) {
 		break;
 
 	case AstNode_BadDecl: break;
-	case AstNode_ValueDecl:
-		n->ValueDecl.names  = clone_ast_node_array(a, n->ValueDecl.names);
-		n->ValueDecl.type   = clone_ast_node(a, n->ValueDecl.type);
-		n->ValueDecl.values = clone_ast_node_array(a, n->ValueDecl.values);
-		break;
-	case AstNode_ImportDecl:
-		n->ImportDecl.cond = clone_ast_node(a, n->ImportDecl.cond);
-		n->ImportDecl.note = clone_ast_node(a, n->ImportDecl.note);
-		break;
 	case AstNode_ForeignLibrary:
 		n->ForeignLibrary.cond = clone_ast_node(a, n->ForeignLibrary.cond);
 		break;
@@ -1428,15 +1424,6 @@ AstNode *ast_map_type(AstFile *f, Token token, AstNode *count, AstNode *key, Ast
 }
 
 
-AstNode *ast_value_decl(AstFile *f, Token token, Array<AstNode *> names, AstNode *type, Array<AstNode *> values) {
-	AstNode *result = make_ast_node(f, AstNode_ValueDecl);
-	result->ValueDecl.token  = token;
-	result->ValueDecl.names  = names;
-	result->ValueDecl.type   = type;
-	result->ValueDecl.values = values;
-	return result;
-}
-
 AstNode *ast_proc_decl(AstFile *f, Token token, AstNode *name, AstNode *type, AstNode *body,
                        u64 tags, AstNode *foreign_library, String foreign_name, String link_name) {
 	AstNode *result = make_ast_node(f, AstNode_ProcDecl);
@@ -1451,25 +1438,6 @@ AstNode *ast_proc_decl(AstFile *f, Token token, AstNode *name, AstNode *type, As
 	return result;
 }
 
-AstNode *ast_type_decl(AstFile *f, Token token, AstNode *name, AstNode *type) {
-	AstNode *result = make_ast_node(f, AstNode_TypeDecl);
-	result->TypeDecl.token = token;
-	result->TypeDecl.name  = name;
-	result->TypeDecl.type  = type;
-	return result;
-}
-
-
-AstNode *ast_import_decl(AstFile *f, Token token, bool is_import, Token relpath, Token import_name, AstNode *cond) {
-	AstNode *result = make_ast_node(f, AstNode_ImportDecl);
-	result->ImportDecl.token = token;
-	result->ImportDecl.is_import = is_import;
-	result->ImportDecl.relpath = relpath;
-	result->ImportDecl.import_name = import_name;
-	result->ImportDecl.cond = cond;
-	return result;
-}
-
 AstNode *ast_foreign_library(AstFile *f, Token token, Token filepath, Token library_name, AstNode *cond, bool is_system) {
 	AstNode *result = make_ast_node(f, AstNode_ForeignLibrary);
 	result->ForeignLibrary.token = token;
@@ -1487,6 +1455,41 @@ AstNode *ast_label_decl(AstFile *f, Token token, AstNode *name) {
 	return result;
 }
 
+AstNode *ast_gen_decl(AstFile *f, Token token, Token open, Token close, Array<AstNode *> specs) {
+	AstNode *result = make_ast_node(f, AstNode_GenDecl);
+	result->GenDecl.token = token;
+	result->GenDecl.open  = open;
+	result->GenDecl.close = close;
+	result->GenDecl.specs = specs;
+	return result;
+}
+
+AstNode *ast_value_spec(AstFile *f, Array<AstNode *> names, AstNode *type, Array<AstNode *> values) {
+	AstNode *result = make_ast_node(f, AstNode_ValueSpec);
+	result->ValueSpec.names  = names;
+	result->ValueSpec.type   = type;
+	result->ValueSpec.values = values;
+	return result;
+}
+
+AstNode *ast_type_spec(AstFile *f, AstNode *name, AstNode *type) {
+	AstNode *result = make_ast_node(f, AstNode_TypeSpec);
+	result->TypeSpec.name = name;
+	result->TypeSpec.type = type;
+	return result;
+}
+
+AstNode *ast_import_spec(AstFile *f, bool is_import, Token relpath, Token import_name, AstNode *cond) {
+	AstNode *result = make_ast_node(f, AstNode_ImportSpec);
+	result->ImportSpec.is_import   = is_import;
+	result->ImportSpec.relpath     = relpath;
+	result->ImportSpec.import_name = import_name;
+	result->ImportSpec.cond        = cond;
+	return result;
+}
+
+
+
 
 bool next_token(AstFile *f) {
 	Token prev = f->curr_token;
@@ -1688,18 +1691,9 @@ bool is_semicolon_optional_for_node(AstFile *f, AstNode *s) {
 		return s->ProcLit.body != NULL;
 	case AstNode_ProcDecl:
 		return s->ProcDecl.body != NULL;
-	case AstNode_TypeDecl:
-		return is_semicolon_optional_for_node(f, s->TypeDecl.type);
 
-
-	case AstNode_ValueDecl:
-		if (s->ValueDecl.token.kind != Token_const) {
-			if (s->ValueDecl.values.count > 0) {
-				AstNode *last = s->ValueDecl.values[s->ValueDecl.values.count-1];
-				return is_semicolon_optional_for_node(f, last);
-			}
-		}
-		break;
+	case AstNode_TypeSpec:
+		return is_semicolon_optional_for_node(f, s->TypeSpec.type);
 	}
 
 	return false;
@@ -2526,12 +2520,73 @@ AstNode *parse_type(AstFile *f) {
 	return type;
 }
 
+AstNode *parse_proc_decl(AstFile *f) {
+	TokenKind look_ahead = look_ahead_token_kind(f, 1);
+	if (look_ahead != Token_Ident) {
+		return ast_expr_stmt(f, parse_expr(f, true));
+	}
 
-AstNode *parse_value_decl(AstFile *f, Token token) {
-	Array<AstNode *> lhs = parse_lhs_expr_list(f);
+	Token token = expect_token(f, Token_proc);
+	AstNode *body = NULL;
+	AstNode *foreign_library = NULL;
+	String foreign_name = {};
+	String link_name = {};
+
+
+	AstNode *name = parse_ident(f);
+	AstNode *type = parse_proc_type(f, token, &foreign_library, &foreign_name, &link_name);
+	u64 tags = type->ProcType.tags;
+
+	if (f->curr_token.kind == Token_OpenBrace) {
+		if ((tags & ProcTag_foreign) != 0) {
+			syntax_error(token, "A procedure tagged as `#foreign` cannot have a body");
+		}
+		AstNode *curr_proc = f->curr_proc;
+		f->curr_proc = type;
+		body = parse_body(f);
+		f->curr_proc = curr_proc;
+	}
+
+	return ast_proc_decl(f, token, name, type, body, tags, foreign_library, foreign_name, link_name);
+}
+
+
+#define PARSE_SPEC_FUNC(name) AstNode *name(AstFile *f, Token token)
+typedef PARSE_SPEC_FUNC(ParseSpecFunc);
+
+AstNode *parse_gen_decl(AstFile *f, Token token, ParseSpecFunc *func) {
+	Array<AstNode *> specs = {};
+	Token open = {};
+	Token close = {};
+
+	if (f->curr_token.kind == Token_OpenParen) {
+		specs = make_ast_node_array(f);
+		open = expect_token(f, Token_OpenParen);
+		while (f->curr_token.kind != Token_CloseParen &&
+		       f->curr_token.kind != Token_EOF) {
+			AstNode *spec = func(f, token);
+			array_add(&specs, spec);
+			expect_semicolon(f, spec);
+		}
+		close = expect_token(f, Token_CloseParen);
+	} else {
+		array_init(&specs, heap_allocator(), 1);
+		array_add(&specs, func(f, token));
+	}
+
+	AstNode *decl = ast_gen_decl(f, token, open, close, specs);
+	if (token.kind == Token_let) {
+		decl->GenDecl.flags |= VarDeclFlag_immutable;
+	}
+	return decl;
+}
+
+PARSE_SPEC_FUNC(parse_value_spec) {
+	bool is_mutable = token.kind != Token_const;
+
+	Array<AstNode *> names = parse_ident_list(f);
 	AstNode *type = NULL;
 	Array<AstNode *> values = {};
-	bool is_mutable = token.kind != Token_const;
 
 	if (allow_token(f, Token_Colon)) {
 		type = parse_type(f);
@@ -2540,28 +2595,25 @@ AstNode *parse_value_decl(AstFile *f, Token token) {
 		syntax_error(f->curr_token, "Expected a type separator `:` or `=`");
 	}
 
-
-	switch (f->curr_token.kind) {
-	case Token_Eq:
-		next_token(f);
+	if (allow_token(f, Token_Eq)) {
 		values = parse_rhs_expr_list(f);
-		if (values.count > lhs.count) {
+		if (values.count > names.count) {
 			syntax_error(f->curr_token, "Too many values on the right hand side of the declaration");
-		} else if (values.count < lhs.count && !is_mutable) {
+		} else if (values.count < names.count && !is_mutable) {
 			syntax_error(f->curr_token, "All constant declarations must be defined");
 		} else if (values.count == 0) {
 			syntax_error(f->curr_token, "Expected an expression for this declaration");
 		}
-		break;
 	}
 
+
 	if (is_mutable) {
 		if (type == NULL && values.count == 0) {
 			syntax_error(f->curr_token, "Missing variable type or initialization");
 			return ast_bad_decl(f, f->curr_token, f->curr_token);
 		}
 	} else {
-		if (type == NULL && values.count == 0 && lhs.count > 0) {
+		if (type == NULL && values.count == 0 && names.count > 0) {
 			syntax_error(f->curr_token, "Missing constant value");
 			return ast_bad_decl(f, f->curr_token, f->curr_token);
 		}
@@ -2571,51 +2623,106 @@ AstNode *parse_value_decl(AstFile *f, Token token) {
 		values = make_ast_node_array(f);
 	}
 
+	return ast_value_spec(f, names, type, values);
+}
 
-	Array<AstNode *> specs = {};
-	array_init(&specs, heap_allocator(), 1);
-	AstNode *decl =  ast_value_decl(f, token, lhs, type, values);
-	if (token.kind == Token_let) {
-		decl->ValueDecl.flags |= VarDeclFlag_immutable;
-	}
-	return decl;
+PARSE_SPEC_FUNC(parse_type_spec) {
+	AstNode *name = parse_ident(f);
+	AstNode *type = parse_type(f);
+	return ast_type_spec(f, name, type);
 }
 
-AstNode *parse_proc_decl(AstFile *f) {
-	TokenKind look_ahead = look_ahead_token_kind(f, 1);
-	if (look_ahead != Token_Ident) {
-		return ast_expr_stmt(f, parse_expr(f, true));
-	}
+PARSE_SPEC_FUNC(parse_import_spec) {
+	if (token.kind == Token_import) {
+		AstNode *cond = NULL;
+		Token import_name = {};
 
-	Token token = expect_token(f, Token_proc);
-	AstNode *body = NULL;
-	AstNode *foreign_library = NULL;
-	String foreign_name = {};
-	String link_name = {};
+		switch (f->curr_token.kind) {
+		case Token_Period:
+			import_name = f->curr_token;
+			import_name.kind = Token_Ident;
+			next_token(f);
+			break;
+		case Token_Ident:
+			import_name = f->curr_token;
+			next_token(f);
+			break;
+		default:
+			import_name.pos = f->curr_token.pos;
+			break;
+		}
 
+		if (import_name.string == "_") {
+			syntax_error(import_name, "Illegal import name: `_`");
+		}
 
-	AstNode *name = parse_ident(f);
-	AstNode *type = parse_proc_type(f, token, &foreign_library, &foreign_name, &link_name);
-	u64 tags = type->ProcType.tags;
+		Token file_path = expect_token_after(f, Token_String, "import");
+		if (allow_token(f, Token_when)) {
+			cond = parse_expr(f, false);
+		}
 
-	if (f->curr_token.kind == Token_OpenBrace) {
-		if ((tags & ProcTag_foreign) != 0) {
-			syntax_error(token, "A procedure tagged as `#foreign` cannot have a body");
+		AstNode *spec = NULL;
+		if (f->curr_proc != NULL) {
+			syntax_error(import_name, "You cannot use `import` within a procedure. This must be done at the file scope");
+			spec = ast_bad_decl(f, import_name, file_path);
+		} else {
+			spec = ast_import_spec(f, true, file_path, import_name, cond);
 		}
-		AstNode *curr_proc = f->curr_proc;
-		f->curr_proc = type;
-		body = parse_body(f);
-		f->curr_proc = curr_proc;
-	}
+		return spec;
+	} else {
+		AstNode *cond = NULL;
+		Token file_path = expect_token_after(f, Token_String, "import_load");
+		Token import_name = file_path;
+		import_name.string = str_lit(".");
 
-	return ast_proc_decl(f, token, name, type, body, tags, foreign_library, foreign_name, link_name);
+		if (allow_token(f, Token_when)) {
+			cond = parse_expr(f, false);
+		}
+
+		AstNode *spec = NULL;
+		if (f->curr_proc != NULL) {
+			syntax_error(import_name, "You cannot use `import_load` within a procedure. This must be done at the file scope");
+			spec = ast_bad_decl(f, import_name, file_path);
+		} else {
+			spec = ast_import_spec(f, false, file_path, import_name, cond);
+		}
+		return spec;
+	}
 }
 
-AstNode *parse_type_decl(AstFile *f) {
-	Token token = expect_token(f, Token_type);
-	AstNode *name = parse_ident(f);
-	AstNode *type = parse_type(f);
-	return ast_type_decl(f, token, name, type);
+AstNode *parse_decl(AstFile *f) {
+	ParseSpecFunc *func = NULL;
+	switch (f->curr_token.kind) {
+	case Token_var:
+	case Token_const:
+	case Token_let:
+		func = parse_value_spec;
+		break;
+
+	case Token_type:
+		func = parse_type_spec;
+		break;
+
+	case Token_import:
+	case Token_import_load:
+		func = parse_import_spec;
+		break;
+
+	case Token_proc:
+		return parse_proc_decl(f);
+
+	default: {
+		Token tok = f->curr_token;
+		fix_advance_to_next_stmt(f);
+		syntax_error(tok, "Expected a declaration");
+		return ast_bad_decl(f, tok, f->curr_token);
+	}
+	}
+
+	Token token = f->curr_token;
+	next_token(f);
+
+	return parse_gen_decl(f, token, func);
 }
 
 
@@ -2626,8 +2733,7 @@ AstNode *parse_simple_stmt(AstFile *f, StmtAllowFlag flags) {
 	case Token_var:
 	case Token_const:
 	case Token_let:
-		next_token(f);
-		return parse_value_decl(f, token);
+		return parse_decl(f);
 	}
 
 	Array<AstNode *> lhs = parse_lhs_expr_list(f);
@@ -3723,20 +3829,11 @@ AstNode *parse_stmt(AstFile *f) {
 	case Token_var:
 	case Token_const:
 	case Token_let:
-		s = parse_simple_stmt(f, StmtAllowFlag_None);
-		expect_semicolon(f, s);
-		return s;
-
 	case Token_proc:
-		s = parse_proc_decl(f);
-		expect_semicolon(f, s);
-		return s;
-
 	case Token_type:
-		s = parse_type_decl(f);
-		expect_semicolon(f, s);
-		return s;
-
+	case Token_import:
+	case Token_import_load:
+		return parse_decl(f);
 
 	case Token_if:     return parse_if_stmt(f);
 	case Token_when:   return parse_when_stmt(f);
@@ -3767,8 +3864,7 @@ AstNode *parse_stmt(AstFile *f) {
 		AstNode *decl = NULL;
 		if (f->curr_token.kind == Token_var ||
 		    f->curr_token.kind == Token_let) {
-			Token var = f->curr_token; next_token(f);
-			decl = parse_value_decl(f, var);
+			decl = parse_decl(f);
 			expect_semicolon(f, decl);
 		} else {
 			Array<AstNode *> list = parse_lhs_expr_list(f);
@@ -3785,20 +3881,17 @@ AstNode *parse_stmt(AstFile *f) {
 		}
 
 
-		if (decl != NULL && decl->kind == AstNode_ValueDecl) {
-			#if 1
-			if (decl->ValueDecl.token.kind == Token_const) {
-				syntax_error(token, "`using` may not be applied to constant declarations");
+		if (decl != NULL && decl->kind == AstNode_GenDecl) {
+			if (decl->GenDecl.token.kind != Token_var &&
+			    decl->GenDecl.token.kind != Token_let) {
+				syntax_error(token, "`using` may only be applied to variable declarations");
 				return decl;
 			}
 			if (f->curr_proc == NULL) {
 				syntax_error(token, "`using` is not allowed at the file scope");
 			} else {
-				decl->ValueDecl.flags |= VarDeclFlag_using;
+				decl->GenDecl.flags |= VarDeclFlag_using;
 			}
-			#else
-				decl->ValueDecl.flags |= VarDeclFlag_using;
-			#endif
 			return decl;
 		}
 
@@ -3846,6 +3939,7 @@ AstNode *parse_stmt(AstFile *f) {
 		return ast_push_context(f, token, expr, body);
 	} break;
 
+#if 0
 	case Token_import: {
 		Token token = expect_token(f, Token_import);
 		AstNode *cond = NULL;
@@ -3907,6 +4001,7 @@ AstNode *parse_stmt(AstFile *f) {
 		expect_semicolon(f, decl);
 		return decl;
 	}
+#endif
 
 	case Token_Hash: {
 		AstNode *s = NULL;
@@ -3989,14 +4084,15 @@ AstNode *parse_stmt(AstFile *f) {
 		} else if (tag == "thread_local") {
 			AstNode *s = parse_stmt(f);
 
-			if (s->kind == AstNode_ValueDecl) {
-				if (s->ValueDecl.token.kind == Token_const) {
-					syntax_error(token, "`thread_local` may not be applied to constant declarations");
+			if (s->kind == AstNode_GenDecl) {
+				if (s->GenDecl.token.kind != Token_var &&
+				    s->GenDecl.token.kind != Token_let) {
+					syntax_error(token, "`thread_local` may only be applied to variable declarations");
 				}
 				if (f->curr_proc != NULL) {
 					syntax_error(token, "`thread_local` is only allowed at the file scope");
 				} else {
-					s->ValueDecl.flags |= VarDeclFlag_thread_local;
+					s->GenDecl.flags |= VarDeclFlag_thread_local;
 				}
 				return s;
 			}
@@ -4219,87 +4315,94 @@ void parse_setup_file_decls(Parser *p, AstFile *f, String base_dir, Array<AstNod
 		    node->kind != AstNode_EmptyStmt) {
 			// NOTE(bill): Sanity check
 			syntax_error_node(node, "Only declarations are allowed at file scope %.*s", LIT(ast_node_strings[node->kind]));
-		} else if (node->kind == AstNode_ImportDecl) {
-			ast_node(id, ImportDecl, node);
-			String collection_name = {};
-			String oirignal_string = id->relpath.string;
-			String file_str = id->relpath.string;
-			gbAllocator allocator = heap_allocator(); // TODO(bill): Change this allocator
-			String import_file = {};
-
-		#if 0
-			isize colon_pos = -1;
-			for (isize j = 0; j < file_str.len; j++) {
-				if (file_str[j] == ':') {
-					colon_pos = j;
-					break;
-				}
-			}
-			if (colon_pos > 0) {
-				collection_name = make_string(file_str.text, colon_pos);
-				file_str.text += colon_pos+1;
-				file_str.len  -= colon_pos+1;
-			}
+		} else if (node->kind == AstNode_GenDecl) {
+			ast_node(gd, GenDecl, node);
+			if (gd->token.kind == Token_import ||
+			    gd->token.kind == Token_import_load) {
+				for_array(spec_index, gd->specs) {
+					AstNode *spec = gd->specs[spec_index];
+					ast_node(id, ImportSpec, spec);
+					String collection_name = {};
+					String oirignal_string = id->relpath.string;
+					String file_str = id->relpath.string;
+					gbAllocator allocator = heap_allocator(); // TODO(bill): Change this allocator
+					String import_file = {};
+
+				#if 0
+					isize colon_pos = -1;
+					for (isize j = 0; j < file_str.len; j++) {
+						if (file_str[j] == ':') {
+							colon_pos = j;
+							break;
+						}
+					}
+					if (colon_pos > 0) {
+						collection_name = make_string(file_str.text, colon_pos);
+						file_str.text += colon_pos+1;
+						file_str.len  -= colon_pos+1;
+					}
 
-			if (collection_name.len == 0) {
-				syntax_error_node(node, "Missing import collection for path: `%.*s`", LIT(oirignal_string));
-				decls[i] = ast_bad_decl(f, id->relpath, id->relpath);
-				continue;
-			}
+					if (collection_name.len == 0) {
+						syntax_error_node(node, "Missing import collection for path: `%.*s`", LIT(oirignal_string));
+						decls[i] = ast_bad_decl(f, id->relpath, id->relpath);
+						continue;
+					}
 
 
-			if (collection_name == "core") {
-				String abs_path = get_fullpath_core(allocator, file_str);
-				if (gb_file_exists(cast(char *)abs_path.text)) { // NOTE(bill): This should be null terminated
-					import_file = abs_path;
-				}
-			} else if (collection_name == "local") {
-				String rel_path = get_fullpath_relative(allocator, base_dir, file_str);
-				if (gb_file_exists(cast(char *)rel_path.text)) { // NOTE(bill): This should be null terminated
-					import_file = rel_path;
-				}
-			} else {
-				syntax_error_node(node, "Unknown import collection: `%.*s`", LIT(collection_name));
-				decls[i] = ast_bad_decl(f, id->relpath, id->relpath);
-				continue;
-			}
+					if (collection_name == "core") {
+						String abs_path = get_fullpath_core(allocator, file_str);
+						if (gb_file_exists(cast(char *)abs_path.text)) { // NOTE(bill): This should be null terminated
+							import_file = abs_path;
+						}
+					} else if (collection_name == "local") {
+						String rel_path = get_fullpath_relative(allocator, base_dir, file_str);
+						if (gb_file_exists(cast(char *)rel_path.text)) { // NOTE(bill): This should be null terminated
+							import_file = rel_path;
+						}
+					} else {
+						syntax_error_node(node, "Unknown import collection: `%.*s`", LIT(collection_name));
+						decls[i] = ast_bad_decl(f, id->relpath, id->relpath);
+						continue;
+					}
 
-			if (!is_import_path_valid(file_str)) {
-				if (id->is_import) {
-					syntax_error_node(node, "Invalid import path: `%.*s`", LIT(file_str));
-				} else {
-					syntax_error_node(node, "Invalid include path: `%.*s`", LIT(file_str));
-				}
-				// NOTE(bill): It's a naughty name
-				decls[i] = ast_bad_decl(f, id->relpath, id->relpath);
-				continue;
-			}
+					if (!is_import_path_valid(file_str)) {
+						if (id->is_import) {
+							syntax_error_node(node, "Invalid import path: `%.*s`", LIT(file_str));
+						} else {
+							syntax_error_node(node, "Invalid include path: `%.*s`", LIT(file_str));
+						}
+						// NOTE(bill): It's a naughty name
+						decls[i] = ast_bad_decl(f, id->relpath, id->relpath);
+						continue;
+					}
 
-		#else
-			if (!is_import_path_valid(file_str)) {
-				if (id->is_import) {
-					syntax_error_node(node, "Invalid import path: `%.*s`", LIT(file_str));
-				} else {
-					syntax_error_node(node, "Invalid include path: `%.*s`", LIT(file_str));
-				}
-				// NOTE(bill): It's a naughty name
-				decls[i] = ast_bad_decl(f, id->relpath, id->relpath);
-				continue;
-			}
+				#else
+					if (!is_import_path_valid(file_str)) {
+						if (id->is_import) {
+							syntax_error_node(node, "Invalid import path: `%.*s`", LIT(file_str));
+						} else {
+							syntax_error_node(node, "Invalid include path: `%.*s`", LIT(file_str));
+						}
+						// NOTE(bill): It's a naughty name
+						decls[i] = ast_bad_decl(f, id->relpath, id->relpath);
+						continue;
+					}
 
 
-			String rel_path = get_fullpath_relative(allocator, base_dir, file_str);
-			import_file = rel_path;
-			if (!gb_file_exists(cast(char *)rel_path.text)) { // NOTE(bill): This should be null terminated
-				String abs_path = get_fullpath_core(allocator, file_str);
-				if (gb_file_exists(cast(char *)abs_path.text)) {
-					import_file = abs_path;
+					String rel_path = get_fullpath_relative(allocator, base_dir, file_str);
+					import_file = rel_path;
+					if (!gb_file_exists(cast(char *)rel_path.text)) { // NOTE(bill): This should be null terminated
+						String abs_path = get_fullpath_core(allocator, file_str);
+						if (gb_file_exists(cast(char *)abs_path.text)) {
+							import_file = abs_path;
+						}
+					}
+				#endif
+
+					id->fullpath = import_file;
+					try_add_import_path(p, import_file, file_str, ast_node_token(node).pos);
 				}
 			}
-		#endif
-
-			id->fullpath = import_file;
-			try_add_import_path(p, import_file, file_str, ast_node_token(node).pos);
 		} else if (node->kind == AstNode_ForeignLibrary) {
 			AstNodeForeignLibrary *fl = &node->ForeignLibrary;
 			String file_str = fl->filepath.string;

+ 1 - 56
src/ssa.cpp

@@ -1948,7 +1948,7 @@ void ssa_build_stmt_internal(ssaProc *p, AstNode *node) {
 	case_ast_node(us, UsingStmt, node);
 		for_array(i, us->list) {
 			AstNode *decl = unparen_expr(us->list[i]);
-			if (decl->kind == AstNode_ValueDecl) {
+			if (decl->kind == AstNode_GenDecl) {
 				ssa_build_stmt(p, decl);
 			}
 		}
@@ -1968,61 +1968,6 @@ void ssa_build_stmt_internal(ssaProc *p, AstNode *node) {
 		ssa_build_assign_op(p, addr, ssa_const_int(p, t, 1), op);
 	case_end;
 
-	case_ast_node(vd, ValueDecl, node);
-		if (vd->token.kind != Token_const) {
-			ssaModule *m = p->module;
-			gbTempArenaMemory tmp = gb_temp_arena_memory_begin(&m->tmp_arena);
-			if (vd->values.count == 0) {
-				for_array(i, vd->names) {
-					AstNode *name = vd->names[i];
-					if (!ssa_is_blank_ident(name)) {
-						ssa_add_local_for_ident(p, name);
-					}
-				}
-			} else {
-				Array<ssaAddr> lvals = {0};
-				Array<ssaValue *>  inits = {0};
-				array_init(&lvals, m->tmp_allocator, vd->names.count);
-				array_init(&inits, m->tmp_allocator, vd->names.count);
-
-				for_array(i, vd->names) {
-					AstNode *name = vd->names[i];
-					ssaAddr lval = ssa_addr(NULL);
-					if (!ssa_is_blank_ident(name)) {
-						lval = ssa_add_local_for_ident(p, name);
-					}
-
-					array_add(&lvals, lval);
-				}
-
-				for_array(i, vd->values) {
-					ssaValue *init = ssa_build_expr(p, vd->values[i]);
-					if (init == NULL) { // TODO(bill): remove this
-						continue;
-					}
-					Type *t = base_type(init->type);
-					if (t->kind == Type_Tuple) {
-						for (isize i = 0; i < t->Tuple.variable_count; i++) {
-							// Entity *e = t->Tuple.variables[i];
-							ssaValue *v = ssa_emit_value_index(p, init, i);
-							array_add(&inits, v);
-						}
-					} else {
-						array_add(&inits, init);
-					}
-				}
-
-				for_array(i, inits) {
-					ssa_addr_store(p, lvals[i], inits[i]);
-				}
-			}
-
-			gb_temp_arena_memory_end(tmp);
-		} else {
-			GB_PANIC("TODO(bill): ssa_build_stmt Type/Proc Entities");
-		}
-	case_end;
-
 	case_ast_node(as, AssignStmt, node);
 		ssa_emit_comment(p, str_lit("AssignStmt"));