jievro-parser 0.6.1 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/lib/jievro/parser/grammar/declaration/constant_declaration.treetop +1 -1
  4. data/lib/jievro/parser/grammar/declaration/function_declaration.treetop +1 -1
  5. data/lib/jievro/parser/grammar/declaration/variable_declaration.treetop +1 -1
  6. data/lib/jievro/parser/grammar/expression/closure_expression.treetop +1 -1
  7. data/lib/jievro/parser/grammar/expression/function_call_expression.treetop +1 -1
  8. data/lib/jievro/parser/grammar/expression/parenthesized_expression.treetop +1 -1
  9. data/lib/jievro/parser/grammar/expression/prefix_expression.treetop +1 -1
  10. data/lib/jievro/parser/grammar/expression/range_expression.treetop +1 -1
  11. data/lib/jievro/parser/grammar/expression/self_expression.treetop +1 -1
  12. data/lib/jievro/parser/grammar/expression/super_expression.treetop +1 -1
  13. data/lib/jievro/parser/grammar/grammar.treetop +1 -1
  14. data/lib/jievro/parser/grammar/identifier.treetop +2 -2
  15. data/lib/jievro/parser/grammar/implicit_parameter_name.treetop +1 -1
  16. data/lib/jievro/parser/grammar/literal/literal_array.treetop +1 -1
  17. data/lib/jievro/parser/grammar/literal/literal_boolean.treetop +2 -2
  18. data/lib/jievro/parser/grammar/literal/literal_decimal_floating_point.treetop +1 -1
  19. data/lib/jievro/parser/grammar/literal/literal_dictionary.treetop +2 -2
  20. data/lib/jievro/parser/grammar/literal/literal_hexadecimal_floating_point.treetop +1 -1
  21. data/lib/jievro/parser/grammar/literal/literal_integer_binary.treetop +1 -1
  22. data/lib/jievro/parser/grammar/literal/literal_integer_decimal.treetop +1 -1
  23. data/lib/jievro/parser/grammar/literal/literal_integer_hexadecimal.treetop +1 -1
  24. data/lib/jievro/parser/grammar/literal/literal_integer_octal.treetop +1 -1
  25. data/lib/jievro/parser/grammar/literal/literal_nil.treetop +1 -1
  26. data/lib/jievro/parser/grammar/literal/literal_string.treetop +3 -3
  27. data/lib/jievro/parser/grammar/statement/branch/if.treetop +1 -1
  28. data/lib/jievro/parser/grammar/statement/loop/do_while.treetop +1 -1
  29. data/lib/jievro/parser/grammar/statement/loop/for.treetop +1 -1
  30. data/lib/jievro/parser/grammar/statement/loop/for_in.treetop +1 -1
  31. data/lib/jievro/parser/grammar/statement/loop/while.treetop +1 -1
  32. data/lib/jievro/parser/grammar/type/type_array.treetop +1 -1
  33. data/lib/jievro/parser/grammar/type/type_dictionary.treetop +1 -1
  34. data/lib/jievro/parser/grammar/wildcard.treetop +1 -1
  35. data/lib/jievro/parser/string_parser.rb +1 -1
  36. data/lib/jievro/parser/tools/shunting_yard.rb +1 -1
  37. data/lib/jievro/parser/version.rb +1 -1
  38. metadata +15 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5bdcaef356796c54cd724cd77c511735e4f4994e
4
- data.tar.gz: 5cf05821c9ae2605e831cb526b81670d513ab081
3
+ metadata.gz: 9265ff73d1bf35da428218e5880fadd8db1742d4
4
+ data.tar.gz: aac8b8c5d9b50f766ab0a0f91f1a633753ab3dc8
5
5
  SHA512:
6
- metadata.gz: 941ca603421044d15e4dc69ec4aabd4632ede9eff55a975b259c5fd7b2386ce168880c96138f372901aa8c2a33a6ffda475b1d346a00b51e97553f97e50e77e2
7
- data.tar.gz: 156ef5c0991a4b4a102eac35d88c804d7e700d762b909bdcd20452e6a2d7c0ee50d9b226e0f4e1b2e2f22f290f21ff5a055bd1de876968cb648c289e9a4e3910
6
+ metadata.gz: 2783011135c322c5d83a8b6c5e796705e296c665b7233758c4bb06708a3e97ab8c8ae9fe3df82a5f68859b17e4610a0755103129c4be6963fb8d8b8c7c80ea0f
7
+ data.tar.gz: 9ea99720dd29d55207ef5f74f146f9e0de39ea8195b8e552eed504de979e4e88a676c132884bea17d0f19713814aaaf455b4fc6e97969d679ebfb3af32c7ea82
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jievro-parser (0.6.0)
4
+ jievro-parser (0.7.0)
5
5
  treetop (~> 1.6)
6
6
 
7
7
  GEM
@@ -24,7 +24,7 @@ module Kauri
24
24
 
25
25
  pattern_initializer_list.ast.each { |e|
26
26
  ast.push({
27
- block_type: 'constant-declaration',
27
+ node_type: 'constant-declaration',
28
28
  pattern: e[:pattern],
29
29
  initializer: e[:initializer]
30
30
  })
@@ -40,7 +40,7 @@ module Kauri
40
40
 
41
41
  [
42
42
  {
43
- block_type: 'function-declaration',
43
+ node_type: 'function-declaration',
44
44
  name: name,
45
45
  parameters: parameters,
46
46
  return_type: return_type,
@@ -24,7 +24,7 @@ module Kauri
24
24
 
25
25
  pattern_initializer_list.ast.each { |e|
26
26
  ast.push({
27
- block_type: 'variable-declaration',
27
+ node_type: 'variable-declaration',
28
28
  pattern: e[:pattern],
29
29
  initializer: e[:initializer]
30
30
  })
@@ -40,7 +40,7 @@ module Kauri
40
40
  def ast
41
41
 
42
42
  ast = {
43
- block_type: 'closure-expression',
43
+ node_type: 'closure-expression',
44
44
  body: statement_list.ast
45
45
  }
46
46
 
@@ -20,7 +20,7 @@ module Kauri
20
20
  def ast
21
21
  [
22
22
  {
23
- block_type: 'function-call-expression',
23
+ node_type: 'function-call-expression',
24
24
  callee: callee.ast.first,
25
25
  parameters: parameters.ast
26
26
  }
@@ -134,7 +134,7 @@ module Kauri
134
134
  def ast
135
135
  [
136
136
  {
137
- block_type: 'expression-element',
137
+ node_type: 'expression-element',
138
138
  identifier: identifier.ast.first,
139
139
  expression: expression.ast.first
140
140
  }
@@ -13,7 +13,7 @@ module Kauri
13
13
  def ast
14
14
  [
15
15
  {
16
- block_type: 'prefix-expression',
16
+ node_type: 'prefix-expression',
17
17
  operator: operator.operator,
18
18
  argument: expression.ast.first
19
19
  }
@@ -27,7 +27,7 @@ module Kauri
27
27
  def ast
28
28
  [
29
29
  {
30
- block_type: 'binary-expression',
30
+ node_type: 'binary-expression',
31
31
  operator: range_operator.text_value,
32
32
  left: left.ast.first,
33
33
  right: right.ast.first
@@ -15,7 +15,7 @@ module Kauri
15
15
  def ast
16
16
  [
17
17
  {
18
- block_type: 'self-expression'
18
+ node_type: 'self-expression'
19
19
  }
20
20
  ]
21
21
  end
@@ -15,7 +15,7 @@ module Kauri
15
15
  def ast
16
16
  [
17
17
  {
18
- block_type: 'super-expression'
18
+ node_type: 'super-expression'
19
19
  }
20
20
  ]
21
21
  end
@@ -61,7 +61,7 @@ module Jievro
61
61
  end
62
62
 
63
63
  {
64
- block_type: 'program',
64
+ node_type: 'program',
65
65
  body: body
66
66
  }
67
67
  end
@@ -23,7 +23,7 @@ module Kauri
23
23
  def ast
24
24
  [
25
25
  {
26
- block_type: 'identifier',
26
+ node_type: 'identifier',
27
27
  value: text_value
28
28
  }
29
29
  ]
@@ -45,7 +45,7 @@ module Kauri
45
45
  def ast
46
46
  [
47
47
  {
48
- block_type: 'identifier',
48
+ node_type: 'identifier',
49
49
  value: regular_identifier.text_value
50
50
  }
51
51
  ]
@@ -15,7 +15,7 @@ module Kauri
15
15
  def ast
16
16
  [
17
17
  {
18
- block_type: 'implicit-parameter-name',
18
+ node_type: 'implicit-parameter-name',
19
19
  value: literal_integer_decimal.text_value,
20
20
  }
21
21
  ]
@@ -41,7 +41,7 @@ module Kauri
41
41
 
42
42
  [
43
43
  {
44
- block_type: 'literal-array',
44
+ node_type: 'literal-array',
45
45
  values: values
46
46
  }
47
47
  ]
@@ -18,7 +18,7 @@ module Kauri
18
18
  def ast
19
19
  [
20
20
  {
21
- block_type: 'literal-boolean',
21
+ node_type: 'literal-boolean',
22
22
  value: true
23
23
  }
24
24
  ]
@@ -39,7 +39,7 @@ module Kauri
39
39
  def ast
40
40
  [
41
41
  {
42
- block_type: 'literal-boolean',
42
+ node_type: 'literal-boolean',
43
43
  value: false
44
44
  }
45
45
  ]
@@ -26,7 +26,7 @@ module Kauri
26
26
 
27
27
  [
28
28
  {
29
- block_type: 'literal-double',
29
+ node_type: 'literal-double',
30
30
  value: converter.convert(text_value)
31
31
  }
32
32
  ]
@@ -57,7 +57,7 @@ module Kauri
57
57
  ast = items.ast
58
58
  else
59
59
  ast = [{
60
- block_type: 'literal-dictionary',
60
+ node_type: 'literal-dictionary',
61
61
  pairs: []
62
62
  }]
63
63
  end
@@ -146,7 +146,7 @@ module Kauri
146
146
 
147
147
  [
148
148
  {
149
- block_type: 'literal-dictionary',
149
+ node_type: 'literal-dictionary',
150
150
  pairs: pairs
151
151
  }
152
152
  ]
@@ -24,7 +24,7 @@ module Kauri
24
24
 
25
25
  [
26
26
  {
27
- block_type: 'literal-double',
27
+ node_type: 'literal-double',
28
28
  value: converter.convert(text_value)
29
29
  }
30
30
  ]
@@ -20,7 +20,7 @@ module Kauri
20
20
 
21
21
  [
22
22
  {
23
- block_type: 'literal-integer',
23
+ node_type: 'literal-integer',
24
24
  value: converter.convert(text_value)
25
25
  }
26
26
  ]
@@ -20,7 +20,7 @@ module Kauri
20
20
 
21
21
  [
22
22
  {
23
- block_type: 'literal-integer',
23
+ node_type: 'literal-integer',
24
24
  value: converter.convert(text_value)
25
25
  }
26
26
  ]
@@ -20,7 +20,7 @@ module Kauri
20
20
 
21
21
  [
22
22
  {
23
- block_type: 'literal-integer',
23
+ node_type: 'literal-integer',
24
24
  value: converter.convert(text_value)
25
25
  }
26
26
  ]
@@ -20,7 +20,7 @@ module Kauri
20
20
 
21
21
  [
22
22
  {
23
- block_type: 'literal-integer',
23
+ node_type: 'literal-integer',
24
24
  value: converter.convert(text_value)
25
25
  }
26
26
  ]
@@ -15,7 +15,7 @@ module Kauri
15
15
  def ast
16
16
  [
17
17
  {
18
- block_type: 'literal-nil'
18
+ node_type: 'literal-nil'
19
19
  }
20
20
  ]
21
21
  end
@@ -29,7 +29,7 @@ module Kauri
29
29
  if quoted_text.text_value.empty?
30
30
  ast = [
31
31
  {
32
- block_type: 'literal-string',
32
+ node_type: 'literal-string',
33
33
  value: ''
34
34
  }
35
35
  ]
@@ -75,7 +75,7 @@ module Kauri
75
75
  ast[-1][:value] += value
76
76
  else
77
77
  ast.push({
78
- block_type: 'literal-string',
78
+ node_type: 'literal-string',
79
79
  value: value
80
80
  })
81
81
  end
@@ -86,7 +86,7 @@ module Kauri
86
86
  if is_interpolated_string
87
87
  ast = [
88
88
  {
89
- block_type: 'interpolated-string',
89
+ node_type: 'interpolated-string',
90
90
  value: ast
91
91
  }
92
92
  ]
@@ -20,7 +20,7 @@ module Kauri
20
20
  def ast
21
21
 
22
22
  ast = {
23
- block_type: 'if-statement',
23
+ node_type: 'if-statement',
24
24
  condition: condition.ast.first,
25
25
  body: body.ast
26
26
  }
@@ -20,7 +20,7 @@ module Kauri
20
20
  def ast
21
21
  [
22
22
  {
23
- block_type: 'do-while-statement',
23
+ node_type: 'do-while-statement',
24
24
  body: body.ast,
25
25
  test: test.ast.first
26
26
  }
@@ -25,7 +25,7 @@ module Kauri
25
25
  body = for_body.ast
26
26
 
27
27
  ast = {
28
- block_type: 'for-statement',
28
+ node_type: 'for-statement',
29
29
  init: init
30
30
  }
31
31
 
@@ -22,7 +22,7 @@ module Kauri
22
22
  def ast
23
23
  [
24
24
  {
25
- block_type: 'for-in-statement',
25
+ node_type: 'for-in-statement',
26
26
  iterator: iterator.ast.first,
27
27
  collection: collection.ast.first,
28
28
  body: body.ast
@@ -18,7 +18,7 @@ module Kauri
18
18
  def ast
19
19
  [
20
20
  {
21
- block_type: 'while-statement',
21
+ node_type: 'while-statement',
22
22
  condition: condition.ast.first,
23
23
  body: body.ast
24
24
  }
@@ -32,7 +32,7 @@ module Kauri
32
32
  def ast
33
33
  [
34
34
  {
35
- block_type: 'array',
35
+ node_type: 'array',
36
36
  type: type.ast.first
37
37
  }
38
38
  ]
@@ -47,7 +47,7 @@ module Kauri
47
47
  def ast
48
48
  [
49
49
  {
50
- block_type: 'dictionary',
50
+ node_type: 'dictionary',
51
51
  key_type: key_type.ast.first,
52
52
  value_type: value_type.ast.first
53
53
  }
@@ -15,7 +15,7 @@ module Kauri
15
15
  def ast
16
16
  [
17
17
  {
18
- block_type: 'wildcard'
18
+ node_type: 'wildcard'
19
19
  }
20
20
  ]
21
21
  end
@@ -12,7 +12,7 @@ module Jievro
12
12
 
13
13
  tokens = []
14
14
  ast = {
15
- block_type: 'program',
15
+ node_type: 'program',
16
16
  body: []
17
17
  }
18
18
 
@@ -17,7 +17,7 @@ module Jievro
17
17
  left = node_stack.pop
18
18
 
19
19
  node_stack.push({
20
- block_type: 'binary-expression',
20
+ node_type: 'binary-expression',
21
21
  operator: token,
22
22
  left: left,
23
23
  right: right
@@ -1,5 +1,5 @@
1
1
  module Jievro
2
2
  module Parser
3
- VERSION = '0.6.1'
3
+ VERSION = '0.7.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,69 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jievro-parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefano Azzalini
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-05 00:00:00.000000000 Z
11
+ date: 2015-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: treetop
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.6'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.6'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.9'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.9'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
47
  version: '10.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
54
  version: '10.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
61
  version: '3.2'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ~>
67
67
  - !ruby/object:Gem::Version
68
68
  version: '3.2'
69
69
  description:
@@ -72,8 +72,8 @@ executables: []
72
72
  extensions: []
73
73
  extra_rdoc_files: []
74
74
  files:
75
- - ".gitignore"
76
- - ".travis.yml"
75
+ - .gitignore
76
+ - .travis.yml
77
77
  - Gemfile
78
78
  - Gemfile.lock
79
79
  - LICENSE.txt
@@ -161,17 +161,17 @@ require_paths:
161
161
  - lib
162
162
  required_ruby_version: !ruby/object:Gem::Requirement
163
163
  requirements:
164
- - - "~>"
164
+ - - ~>
165
165
  - !ruby/object:Gem::Version
166
166
  version: '2.0'
167
167
  required_rubygems_version: !ruby/object:Gem::Requirement
168
168
  requirements:
169
- - - ">="
169
+ - - '>='
170
170
  - !ruby/object:Gem::Version
171
171
  version: '0'
172
172
  requirements: []
173
173
  rubyforge_project:
174
- rubygems_version: 2.4.6
174
+ rubygems_version: 2.0.14
175
175
  signing_key:
176
176
  specification_version: 4
177
177
  summary: Source code parser used internally by jievro