jievro-parser 0.4.0 → 0.5.0

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: 14e2978148043c35f1cc7228b7586fe4383bceda
4
- data.tar.gz: 64604bffdc949996288c78a90a8a04507011c03c
3
+ metadata.gz: b82db236ed40ea039b1c0bd30f0ac134ae2465ba
4
+ data.tar.gz: f1f43a531b64ffdddcb356d0b44f469da7c8801b
5
5
  SHA512:
6
- metadata.gz: 01489d03f902d929fe888fc49ab402fb156d9ea916197b6239527262bed880e29119774003030e0557c0331b67de375a80e3fcfcc5bc4cb783a52c2749f4f942
7
- data.tar.gz: f3a20355d13406bf740a7604f469639d747ec38d093ce25ac277eefc36047a38663e3c13dcf5898e15584da7e1a78510aa6e270fa8fd551418f8d6b6014f3d5f
6
+ metadata.gz: 07a6a4cd021b6f64ebf6122a1456615ced2b76bf016aa3f5516a2f33713df8bc34cd01659f0ec9deb16b4b6b27e2e552a46f6b1070a947bdbc8709e4ec2a69dd
7
+ data.tar.gz: 0f50db01513965bf9df975a06a7dac9d4b373007ae8bc8f6bb279b539efa535b583701ccc72040f94fe141359475634bbafb8f0ac90224e9eda8b2e7811fb7ee
data/Gemfile CHANGED
@@ -1,6 +1,3 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'rake'
4
- gem 'treetop'
5
- gem 'polyglot'
6
- gem 'rspec', :require => 'spec'
3
+ gemspec
data/Gemfile.lock CHANGED
@@ -1,30 +1,36 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ jievro-parser (0.5.0)
5
+ treetop (~> 1.6)
6
+
1
7
  GEM
2
8
  remote: https://rubygems.org/
3
9
  specs:
4
10
  diff-lcs (1.2.5)
5
11
  polyglot (0.3.5)
6
- rake (10.3.2)
12
+ rake (10.4.2)
7
13
  rspec (3.2.0)
8
14
  rspec-core (~> 3.2.0)
9
15
  rspec-expectations (~> 3.2.0)
10
16
  rspec-mocks (~> 3.2.0)
11
- rspec-core (3.2.2)
17
+ rspec-core (3.2.3)
12
18
  rspec-support (~> 3.2.0)
13
- rspec-expectations (3.2.0)
19
+ rspec-expectations (3.2.1)
14
20
  diff-lcs (>= 1.2.0, < 2.0)
15
21
  rspec-support (~> 3.2.0)
16
22
  rspec-mocks (3.2.1)
17
23
  diff-lcs (>= 1.2.0, < 2.0)
18
24
  rspec-support (~> 3.2.0)
19
25
  rspec-support (3.2.2)
20
- treetop (1.5.3)
26
+ treetop (1.6.2)
21
27
  polyglot (~> 0.3)
22
28
 
23
29
  PLATFORMS
24
30
  ruby
25
31
 
26
32
  DEPENDENCIES
27
- polyglot
28
- rake
29
- rspec
30
- treetop
33
+ bundler (~> 1.9)
34
+ jievro-parser!
35
+ rake (~> 10.0)
36
+ rspec (~> 3.2)
data/README.md CHANGED
@@ -1 +1,5 @@
1
- # jievro ~ parser [![Build Status](https://travis-ci.org/jievro/parser.svg?branch=develop)](https://travis-ci.org/jievro/parser)
1
+ #parser
2
+
3
+ [![Build Status](https://travis-ci.org/jievro/parser.svg?branch=develop)](https://travis-ci.org/jievro/parser)
4
+ [![GitHub Version](https://badge.fury.io/gh/jievro%2Fparser.svg)](http://badge.fury.io/gh/jievro%2Fparser)
5
+ [![Gem Version](https://badge.fury.io/rb/jievro-parser.svg)](http://badge.fury.io/rb/jievro-parser)
data/lib/parser/parser.rb CHANGED
@@ -4,31 +4,32 @@ require 'parser/grammar/grammar'
4
4
  require 'parser/parse_result'
5
5
 
6
6
  module Jievro
7
- class Parser
7
+ module Parser
8
+ class Parser
9
+ def parse(source)
8
10
 
9
- @@parser = Jievro::SwiftParser.new
11
+ parser = Jievro::SwiftParser.new
10
12
 
11
- def self.parse(source)
13
+ tokens = []
14
+ ast = {
15
+ block_type: 'program',
16
+ body: []
17
+ }
12
18
 
13
- tokens = []
14
- ast = {
15
- block_type: 'program',
16
- body: []
17
- }
19
+ unless source.empty?
18
20
 
19
- unless source.empty?
21
+ parsed = parser.parse(source)
20
22
 
21
- parsed = @@parser.parse(source)
23
+ if parsed.nil?
24
+ raise Exception, parser.failure_reason
25
+ end
22
26
 
23
- if parsed.nil?
24
- raise Exception, @@parser.failure_reason
27
+ tokens = parsed.tokens
28
+ ast = parsed.ast
25
29
  end
26
30
 
27
- tokens = parsed.tokens
28
- ast = parsed.ast
31
+ Jievro::ParseResult.new(tokens, ast)
29
32
  end
30
-
31
- Jievro::ParseResult.new(tokens, ast)
32
33
  end
33
34
  end
34
- end
35
+ end
@@ -1,5 +1,5 @@
1
1
  module Jievro
2
2
  module Parser
3
- VERSION = '0.4.0'
3
+ VERSION = '0.5.0'
4
4
  end
5
5
  end
data/parser.gemspec CHANGED
@@ -22,4 +22,5 @@ Gem::Specification.new do |spec|
22
22
 
23
23
  spec.add_development_dependency 'bundler', '~> 1.9'
24
24
  spec.add_development_dependency 'rake', '~> 10.0'
25
+ spec.add_development_dependency 'rspec', '~> 3.2'
25
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jievro-parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefano Azzalini
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - ~>
53
53
  - !ruby/object:Gem::Version
54
54
  version: '10.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '3.2'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: '3.2'
55
69
  description:
56
70
  email: hi@jievro.io
57
71
  executables: []