Skip to content

Commit

Permalink
fix: allow omit 0 units in gcode number parsing (fluidd-core#679)
Browse files Browse the repository at this point in the history
Signed-off-by: Pedro Lamas <[email protected]>
  • Loading branch information
pedrolamas authored and matmen committed Jun 27, 2022
1 parent ddaf610 commit 8f85526
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/workers/parseGcode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function parseLine (line: string) {

const argMap: any = {}

for (const [, key, value] of args.matchAll(/([a-z])[ \t]*(-?\d+(?:\.\d+)?)/ig)) {
for (const [, key, value] of args.matchAll(/([a-z])[ \t]*(-?(?:\d+(?:\.\d+)?|\.\d+))/ig)) {
argMap[key.toLowerCase()] = Number(value)
}

Expand Down

0 comments on commit 8f85526

Please sign in to comment.