Skip to content

Commit

Permalink
Merge pull request #31 from noflo/forresto-xy
Browse files Browse the repository at this point in the history
parseFloat numerical metadata
  • Loading branch information
bergie committed Apr 17, 2015
2 parents b0d04e1 + 79e8a13 commit 0d883f4
Show file tree
Hide file tree
Showing 4 changed files with 1,433 additions and 1,521 deletions.
4 changes: 2 additions & 2 deletions Gruntfile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ module.exports = ->
# Generate library from Peg grammar
peg:
fbp:
grammar: 'grammar/fbp.peg'
outputFile: 'lib/fbp.js'
src: 'grammar/fbp.peg'
dest: 'lib/fbp.js'

# Build the browser Component
noflo_browser:
Expand Down
7 changes: 6 additions & 1 deletion grammar/fbp.peg
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@
if (item.length === 1) {
item = ['routes', item[0]];
}
metadata[item[0]] = item[1];
var key = item[0];
var value = item[1];
if (key==='x' || key==='y') {
value = parseFloat(value);
}
metadata[key] = value;
}
nodes[nodeName].metadata=metadata;
}
Expand Down
Loading

0 comments on commit 0d883f4

Please sign in to comment.