mirror of
https://github.com/Strum355/mcshader-lsp.git
synced 2025-07-08 03:45:40 +00:00
18 lines
No EOL
662 B
Python
18 lines
No EOL
662 B
Python
with open('shaders.txt') as f:
|
|
items = {}
|
|
lines = filter(lambda s: s.startswith('uniform'), f.readlines())
|
|
for line in lines:
|
|
err = False
|
|
try:
|
|
detail = int(' '.join(line.split()[3:]))
|
|
err = True
|
|
except:
|
|
pass
|
|
type = line.split()[1].rstrip('>').lstrip('<')
|
|
detail = ' '.join(line.split()[3:]) if not err else ''
|
|
label = line.split()[2].rstrip(';')
|
|
if label in items:
|
|
continue
|
|
items[label] = True
|
|
detail = ' ' + detail if not detail == '' else ''
|
|
print('{\n\tlabel: \'%s\',\n\tdetail: \'<%s>%s\'\n},' % (label, type, detail)) |