goodguide-gibbon 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  module GoodGuide
2
2
  module Gibbon
3
3
  def self.version
4
- '0.3.5'
4
+ '0.3.6'
5
5
  end
6
6
  end
7
7
  end
@@ -1008,7 +1008,7 @@ Gibbon.TypeAST = TypeAST = (function(_super) {
1008
1008
  })(Union);
1009
1009
 
1010
1010
  parse = Gibbon.parse = (function() {
1011
- var arrow, arrowType, assertString, bang, blockExpr, blockType, comma, comment, component, concrete, decimal, decimalExpr, define, definition, expr, fail, flow, fraction, fractionExpr, frame, freeFrame, fullSignature, func, funcPlaceholder, identifier, ignore, innerFrame, integer, integerExpr, isString, label, labelVal, lbrace, lbrack, lexeme, listExpr, listType, lparen, metadata, name, nativeId, nativeType, nonPairedFlow, numericExpr, pair, parenFlow, parenFrame, parenType, percent, percentExpr, program, query, question, rbrace, rbrack, regex, rparen, signature, simpleType, singletonFlow, str, string, stringExpr, substExpr, succeed, tassign, type, typeVar, variable, whitespace, wildType, wildcard;
1011
+ var accessor, accessorExpr, arrow, arrowType, assertString, bang, blockExpr, blockType, comma, comment, component, concrete, decimal, decimalExpr, define, definition, expr, fail, flow, fraction, fractionExpr, frame, freeFrame, fullSignature, func, funcPlaceholder, identifier, ignore, innerFrame, integer, integerExpr, isString, label, labelVal, lbrace, lbrack, lexeme, listExpr, listType, lparen, metadata, name, nativeId, nativeType, nonPairedFlow, numericExpr, pair, parenFlow, parenFrame, parenType, percent, percentExpr, program, query, queryExpr, question, rbrace, rbrack, regex, rparen, signature, simpleType, singletonFlow, str, string, stringExpr, substExpr, succeed, tassign, type, typeVar, variable, whitespace, wildType, wildcard;
1012
1012
  string = Parsimmon.string, regex = Parsimmon.regex, succeed = Parsimmon.succeed, fail = Parsimmon.fail;
1013
1013
  Parsimmon.Parser.prototype.expected = function(message) {
1014
1014
  var _this = this;
@@ -1046,6 +1046,8 @@ parse = Gibbon.parse = (function() {
1046
1046
  rparen = lexeme(string(')'));
1047
1047
  comma = lexeme(string(','));
1048
1048
  question = lexeme(string('?'));
1049
+ query = lexeme(string('.').then(identifier.expected()));
1050
+ accessor = lexeme(string('@').then(identifier.expected()));
1049
1051
  name = lexeme(identifier);
1050
1052
  str = lexeme(string("'").then(regex(/^[^']*/)).skip(string("'").expected()));
1051
1053
  fraction = lexeme(regex(/^\d+\/\d+/));
@@ -1074,19 +1076,14 @@ parse = Gibbon.parse = (function() {
1074
1076
  stringExpr = str.map(function(s) {
1075
1077
  return AST.string(s);
1076
1078
  });
1077
- query = string('@').then((function() {
1078
- var accessor, fullQuery, parenName;
1079
- parenName = lparen.then(lexeme(identifier).expected()).skip(rparen.expected());
1080
- accessor = parenName.map(function(name) {
1081
- return AST.query('access', name);
1082
- });
1083
- fullQuery = identifier.then(function(q) {
1084
- return parenName.map(function(name) {
1085
- return AST.query(q, name);
1086
- });
1079
+ accessorExpr = accessor.map(function(name) {
1080
+ return AST.query('access', name);
1081
+ });
1082
+ queryExpr = query.then(function(q) {
1083
+ return name.map(function(n) {
1084
+ return AST.query(q, n);
1087
1085
  });
1088
- return accessor.or(fullQuery);
1089
- })());
1086
+ });
1090
1087
  numericExpr = percentExpr.or(decimalExpr.or(fractionExpr.or(integerExpr)));
1091
1088
  parenFlow = lparen.then(function() {
1092
1089
  return flow.expected().skip(rparen.expected());
@@ -1107,7 +1104,7 @@ parse = Gibbon.parse = (function() {
1107
1104
  blockExpr = lbrace.then(function() {
1108
1105
  return flow.skip(rbrace.expected());
1109
1106
  }).map(AST.block);
1110
- expr = query.or(substExpr.or(listExpr.or(stringExpr.or(blockExpr.or(numericExpr)))));
1107
+ expr = queryExpr.or(accessorExpr.or(substExpr.or(listExpr.or(stringExpr.or(blockExpr.or(numericExpr))))));
1111
1108
  singletonFlow = expr.map(function(e) {
1112
1109
  return AST.flow(e, null);
1113
1110
  });
@@ -1002,7 +1002,7 @@ Gibbon.TypeAST = TypeAST = (function(_super) {
1002
1002
  })(Union);
1003
1003
 
1004
1004
  parse = Gibbon.parse = (function() {
1005
- var arrow, arrowType, assertString, bang, blockExpr, blockType, comma, comment, component, concrete, decimal, decimalExpr, define, definition, expr, fail, flow, fraction, fractionExpr, frame, freeFrame, fullSignature, func, funcPlaceholder, identifier, ignore, innerFrame, integer, integerExpr, isString, label, labelVal, lbrace, lbrack, lexeme, listExpr, listType, lparen, metadata, name, nativeId, nativeType, nonPairedFlow, numericExpr, pair, parenFlow, parenFrame, parenType, percent, percentExpr, program, query, question, rbrace, rbrack, regex, rparen, signature, simpleType, singletonFlow, str, string, stringExpr, substExpr, succeed, tassign, type, typeVar, variable, whitespace, wildType, wildcard;
1005
+ var accessor, accessorExpr, arrow, arrowType, assertString, bang, blockExpr, blockType, comma, comment, component, concrete, decimal, decimalExpr, define, definition, expr, fail, flow, fraction, fractionExpr, frame, freeFrame, fullSignature, func, funcPlaceholder, identifier, ignore, innerFrame, integer, integerExpr, isString, label, labelVal, lbrace, lbrack, lexeme, listExpr, listType, lparen, metadata, name, nativeId, nativeType, nonPairedFlow, numericExpr, pair, parenFlow, parenFrame, parenType, percent, percentExpr, program, query, queryExpr, question, rbrace, rbrack, regex, rparen, signature, simpleType, singletonFlow, str, string, stringExpr, substExpr, succeed, tassign, type, typeVar, variable, whitespace, wildType, wildcard;
1006
1006
  string = Parsimmon.string, regex = Parsimmon.regex, succeed = Parsimmon.succeed, fail = Parsimmon.fail;
1007
1007
  Parsimmon.Parser.prototype.expected = function(message) {
1008
1008
  var _this = this;
@@ -1040,6 +1040,8 @@ parse = Gibbon.parse = (function() {
1040
1040
  rparen = lexeme(string(')'));
1041
1041
  comma = lexeme(string(','));
1042
1042
  question = lexeme(string('?'));
1043
+ query = lexeme(string('.').then(identifier.expected()));
1044
+ accessor = lexeme(string('@').then(identifier.expected()));
1043
1045
  name = lexeme(identifier);
1044
1046
  str = lexeme(string("'").then(regex(/^[^']*/)).skip(string("'").expected()));
1045
1047
  fraction = lexeme(regex(/^\d+\/\d+/));
@@ -1068,19 +1070,14 @@ parse = Gibbon.parse = (function() {
1068
1070
  stringExpr = str.map(function(s) {
1069
1071
  return AST.string(s);
1070
1072
  });
1071
- query = string('@').then((function() {
1072
- var accessor, fullQuery, parenName;
1073
- parenName = lparen.then(lexeme(identifier).expected()).skip(rparen.expected());
1074
- accessor = parenName.map(function(name) {
1075
- return AST.query('access', name);
1076
- });
1077
- fullQuery = identifier.then(function(q) {
1078
- return parenName.map(function(name) {
1079
- return AST.query(q, name);
1080
- });
1073
+ accessorExpr = accessor.map(function(name) {
1074
+ return AST.query('access', name);
1075
+ });
1076
+ queryExpr = query.then(function(q) {
1077
+ return name.map(function(n) {
1078
+ return AST.query(q, n);
1081
1079
  });
1082
- return accessor.or(fullQuery);
1083
- })());
1080
+ });
1084
1081
  numericExpr = percentExpr.or(decimalExpr.or(fractionExpr.or(integerExpr)));
1085
1082
  parenFlow = lparen.then(function() {
1086
1083
  return flow.expected().skip(rparen.expected());
@@ -1101,7 +1098,7 @@ parse = Gibbon.parse = (function() {
1101
1098
  blockExpr = lbrace.then(function() {
1102
1099
  return flow.skip(rbrace.expected());
1103
1100
  }).map(AST.block);
1104
- expr = query.or(substExpr.or(listExpr.or(stringExpr.or(blockExpr.or(numericExpr)))));
1101
+ expr = queryExpr.or(accessorExpr.or(substExpr.or(listExpr.or(stringExpr.or(blockExpr.or(numericExpr))))));
1105
1102
  singletonFlow = expr.map(function(e) {
1106
1103
  return AST.flow(e, null);
1107
1104
  });
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: goodguide-gibbon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-07 00:00:00.000000000 Z
12
+ date: 2013-08-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: therubyracer
@@ -55,7 +55,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
55
55
  version: '0'
56
56
  segments:
57
57
  - 0
58
- hash: 1343523825652260222
58
+ hash: -2471759766594341795
59
59
  required_rubygems_version: !ruby/object:Gem::Requirement
60
60
  none: false
61
61
  requirements:
@@ -64,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
64
64
  version: '0'
65
65
  segments:
66
66
  - 0
67
- hash: 1343523825652260222
67
+ hash: -2471759766594341795
68
68
  requirements: []
69
69
  rubyforge_project: goodguide-gibbon
70
70
  rubygems_version: 1.8.23