mirror of
https://github.com/vale981/tridactyl
synced 2025-03-06 01:51:40 -05:00
exmode: Give build-time error on bad arg types
This commit is contained in:
parent
927e19c818
commit
58ed23913d
2 changed files with 4 additions and 1 deletions
|
@ -38,6 +38,8 @@ class Signature:
|
||||||
# Type declaration
|
# Type declaration
|
||||||
if ':' in param:
|
if ':' in param:
|
||||||
name, typ = map(str.strip, param.split(':'))
|
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
|
# Default argument
|
||||||
elif '=' in param:
|
elif '=' in param:
|
||||||
name, default = map(str.strip, param.split('='))
|
name, default = map(str.strip, param.split('='))
|
||||||
|
|
|
@ -17,7 +17,8 @@ function convertArgs(params, argv) {
|
||||||
const conversions = {
|
const conversions = {
|
||||||
number: convert.toNumber,
|
number: convert.toNumber,
|
||||||
boolean: convert.toBoolean,
|
boolean: convert.toBoolean,
|
||||||
string: (s)=>s,
|
string: s=>s,
|
||||||
|
ModeName: s=>s,
|
||||||
}
|
}
|
||||||
|
|
||||||
const typedArgs = []
|
const typedArgs = []
|
||||||
|
|
Loading…
Add table
Reference in a new issue