graphql-libgraphqlparser 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 49728523192a9cd15fd7133a7072c14ca3a8bf1d
4
- data.tar.gz: a23cbef156b74384e73f501d8615744486374224
3
+ metadata.gz: 07f0c2678c705349b226574e8df53883d53c9d0d
4
+ data.tar.gz: 499c9dd6b1be2d74817af23805cc16256e7d0fba
5
5
  SHA512:
6
- metadata.gz: 17ae0ee014ceea5583b0c20b0cd89378e4c4caa411ac058632057c4b45cb06e4fb887eb7140a6d7992f66691c4d187c9e39f6cd7e654e97a11d7a701558d6032
7
- data.tar.gz: 4b09bd2f774f37b577b830bf7f0d35bd08f737667e7cf6a0b990f1c34a40b1b4661448416dfcd49e214c95c90d0ca488dffdd47cc27616576e138046276ef34a
6
+ metadata.gz: 5193587d6b91e318304405f617d9be3942cec68a332c80b9822c120c567457e2957c0d2d4d6bd77d640d51b7228657989e8424af6b9ad856c0bbf799c7514484
7
+ data.tar.gz: 8c2447b588e7e2849865bd5b44b4f8760aa019309e86d320adcd37d7c28b78af241516c36ad76d60b72b8eb64c60b59df9a14e222090693ec0855fcd76ba5586
@@ -12,11 +12,7 @@
12
12
  1, \
13
13
  rb_str_new2(node_name_string) \
14
14
  ); \
15
- struct GraphQLAstLocation* location = malloc(sizeof(struct GraphQLAstLocation)); \
16
- graphql_node_get_location((struct GraphQLAstNode *)node, location); \
17
- rb_funcall(rb_node, line_set_intern, 1, INT2NUM(location->beginLine)); \
18
- rb_funcall(rb_node, col_set_intern, 1, INT2NUM(location->beginColumn)); \
19
- free(location); \
15
+ set_node_location((struct GraphQLAstNode *)node, rb_node);
20
16
 
21
17
  #define END \
22
18
  rb_funcall( \
@@ -58,6 +54,14 @@
58
54
  ); \
59
55
 
60
56
  VALUE type_set_intern, name_set_intern, add_value_intern, end_visit_intern, begin_visit_intern, line_set_intern, col_set_intern;
57
+
58
+ inline void set_node_location(const struct GraphQLAstNode *node, VALUE rb_node) {
59
+ struct GraphQLAstLocation location = {0};
60
+ graphql_node_get_location(node, &location);
61
+ rb_funcall(rb_node, line_set_intern, 1, INT2NUM(location.beginLine));
62
+ rb_funcall(rb_node, col_set_intern, 1, INT2NUM(location.beginColumn));
63
+ }
64
+
61
65
  void init_visitor_functions() {
62
66
  type_set_intern = rb_intern("type=");
63
67
  name_set_intern = rb_intern("name=");
@@ -1,5 +1,5 @@
1
1
  module GraphQL
2
2
  module Libgraphqlparser
3
- VERSION = '0.2.1'
3
+ VERSION = '0.2.2'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql-libgraphqlparser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Mosolgo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-11 00:00:00.000000000 Z
11
+ date: 2016-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: graphql