exmode: Give build-time error on bad arg types

This commit is contained in:
Colin Caine 2017-11-09 05:37:23 +00:00
parent 927e19c818
commit 58ed23913d
2 changed files with 4 additions and 1 deletions

View file

@ -38,6 +38,8 @@ class Signature:
# Type declaration
if ':' in param:
name, typ = map(str.strip, param.split(':'))
if typ not in ('number', 'boolean', 'string', 'string[]', 'ModeName') and '|' not in typ:
raise Exception("Edit me! " + typ + " is not a supported type!")
# Default argument
elif '=' in param:
name, default = map(str.strip, param.split('='))

View file

@ -17,7 +17,8 @@ function convertArgs(params, argv) {
const conversions = {
number: convert.toNumber,
boolean: convert.toBoolean,
string: (s)=>s,
string: s=>s,
ModeName: s=>s,
}
const typedArgs = []