mini: parse numbers
This commit is contained in:
parent
dcebdd6dbc
commit
4bea071071
1 changed files with 2 additions and 1 deletions
|
|
@ -101,10 +101,11 @@ export function patternifyAST(ast: any): any {
|
||||||
return ast.source_;
|
return ast.source_;
|
||||||
}
|
}
|
||||||
const { start, end } = ast.location_;
|
const { start, end } = ast.location_;
|
||||||
|
const value = !isNaN(Number(ast.source_)) ? Number(ast.source_) : ast.source_;
|
||||||
// return ast.source_;
|
// return ast.source_;
|
||||||
// the following line expects the shapeshifter to wrap this in withLocationOffset
|
// the following line expects the shapeshifter to wrap this in withLocationOffset
|
||||||
// because location_ is only relative to the mini string, but we need it relative to whole code
|
// because location_ is only relative to the mini string, but we need it relative to whole code
|
||||||
return pure(ast.source_).withLocation({ start, end });
|
return pure(value).withLocation({ start, end });
|
||||||
}
|
}
|
||||||
return patternifyAST(ast.source_);
|
return patternifyAST(ast.source_);
|
||||||
case 'stretch':
|
case 'stretch':
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue