Implemented update

This commit is contained in:
2022-02-22 13:14:05 +00:00
parent d628c99371
commit b790338b54
8 changed files with 376 additions and 16 deletions

View File

@@ -130,9 +130,21 @@ const readBlock = (tokens, current, superType, typeGraph, options) => {
//insert the block-level modifier signal
if (modifier) {
result[fieldName][modifier] = tokens[current++];
//handle integers and floats exposed to the user
switch(result[fieldName].typeName) {
case 'Integer':
result[fieldName][modifier] = parseInt(tokens[current++]);
break;
case 'Float':
result[fieldName][modifier] = parseFloat(tokens[current++]);
break;
default: //everything else is a string (including booleans)
result[fieldName][modifier] = tokens[current++];
}
} else {
result[fieldName]['set'] = tokens[current++];
throw `Modifier expected for ${fieldName} (either create or match)`;
}
if (options.debug) {