Skip to content

Commit

Permalink
Merge pull request #195 from aiannacc/flexible-rating-criteria-parsing
Browse files Browse the repository at this point in the history
Allow whitespace after rating ranges
  • Loading branch information
michaeljb committed Apr 24, 2014
2 parents 7ee4140 + 8590dcb commit 7bf6b2f
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/ext/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,14 @@
GS.parseProRange = function (tablename) {
var m, range = {};

if ((m = tablename.match(/^(.* |)(\d+(.\d+)?([kK])?)\+(?!\S)/)) !== null) {
if ((m = tablename.match(/^(.* |)(\d+(.\d+)?([kK])?)\+/)) !== null) {
range.min = GS.parseNum(m[2]);
}
if ((m = tablename.match(/^(.* |)(\d+(.\d+)?([kK])?)\-(?!\S)/)) !== null) {
range.max = GS.parseNum(m[2]);
}
if ((m = tablename.match(/^(.* |)(\d+(.\d+)?([kK])?)-(\d+(.\d+)?([kK])?)(?!\S)/)) !== null) {
} else if ((m = tablename.match(/^(.* |)(\d+(.\d+)?([kK])?)-(\d+(.\d+)?([kK])?)/)) !== null) {
range.min = GS.parseNum(m[2]);
range.max = GS.parseNum(m[5]);
}
if ((m = tablename.match(/^(.* |)\+\/\-(\d+(.\d+)?([kK])?)(?!\S)/)) !== null) {
} else if ((m = tablename.match(/^(.* |)(\d+(.\d+)?([kK])?)\-/)) !== null) {
range.max = GS.parseNum(m[2]);
} else if ((m = tablename.match(/^(.* |)\+\/\-(\d+(.\d+)?([kK])?)/)) !== null) {
range.difference = GS.parseNum(m[2]);
}
return range;
Expand Down

0 comments on commit 7bf6b2f

Please sign in to comment.