Skip to content

Commit

Permalink
add support for measurement type
Browse files Browse the repository at this point in the history
  • Loading branch information
jmhw0123 committed Mar 24, 2022
1 parent 0846db3 commit 9242bd8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tool/sample-synthetic-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ function toThingtalkValue(classDef : Ast.ClassDef,
return { value: new Ast.Value.String(value), op: "=~" };
if (type === Type.Number)
return { value: new Ast.Value.Number(parseFloat(value)), op: "==" };
if (type instanceof Type.Measure)
return { value: new Ast.Value.Measure(parseFloat(value), type.unit), op: "==" };
if (type instanceof Type.Array) {
type = type.elem as Type;
if (type instanceof Type.Entity) {
Expand Down

0 comments on commit 9242bd8

Please sign in to comment.