silicon 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: 7da11fceb3dbf78f8953e3971ac3125af7e5254c
4
- data.tar.gz: 707b2eadfa9b4e814171e513342e2d4efee2579e
3
+ metadata.gz: cd1808042898a077bd8f8c0b8d17c4587ced6256
4
+ data.tar.gz: 26ba1b428a0d9ed27cf7b3ef0659608847ea1cf7
5
5
  SHA512:
6
- metadata.gz: 32062840418619974ae913c5dd9c3d818c8a57defbed2c936767237a15a4074ef177b8b19c7d0f067ed63badff31df205557ecd444c3ee653774aaeeb524df83
7
- data.tar.gz: f65e787d25330b351b704c68710be73fcb55ff7cc0f0e1a81b82555d051ef05d27edb4ab32a0586d5c8fedfd040f25245042f8ea1a3b0744aca9b49e372b10ee
6
+ metadata.gz: 47ae3077a06e9525257cc42cffa675574c1f5bfd66387a2233f55722235781003e9aff6df55eafd4a515f4ef4aac86211c388bbe50ff7d6ac05c9317a2a022ea
7
+ data.tar.gz: a095fcf274a8e27b80077857ea408fdf303ae3c53a2a6c9faaada252248fb8c97f6f2ef5967662f6a3008c827c6a16041afc4525f172e41ba22c02693b3d14a6
@@ -1,13 +1,21 @@
1
1
  module Syntax
2
2
  class Command < Treetop::Runtime::SyntaxNode
3
- attr_reader :name
3
+ attr_reader :name, :result_name
4
4
 
5
5
  def parse
6
6
  @is_async = text_value.start_with? '=*'
7
7
  @is_parallel = text_value.start_with? '=>'
8
8
  @is_sequential = text_value.start_with? '*>'
9
9
 
10
- @name = text_value.sub('*>', '').sub('=*', '').sub('=>', '')
10
+ full_name = text_value.sub('*>', '').sub('=*', '').sub('=>', '')
11
+
12
+ if full_name.include? '@'
13
+ parts = full_name.split('@')
14
+ @result_name = parts[0]
15
+ @name = parts[1]
16
+ else
17
+ @name = full_name
18
+ end
11
19
 
12
20
  self
13
21
  end
@@ -0,0 +1,4 @@
1
+ module Syntax
2
+ class ResultName < Treetop::Runtime::SyntaxNode
3
+ end
4
+ end
@@ -6,6 +6,7 @@ require_relative 'syntax/primitives/http_verb'
6
6
  require_relative 'syntax/primitives/http_status'
7
7
  require_relative 'syntax/primitives/parameter'
8
8
  require_relative 'syntax/primitives/path'
9
+ require_relative 'syntax/primitives/result_name'
9
10
 
10
11
  require_relative 'syntax/action'
11
12
  require_relative 'syntax/actions'
@@ -40,7 +40,11 @@ grammar Syntax
40
40
  end
41
41
 
42
42
  rule command
43
- (arrow [a-z0-9_]+) 1..1 <Command>
43
+ (arrow result_name [a-z0-9_]+) 1..1 <Command>
44
+ end
45
+
46
+ rule result_name
47
+ ([a-z0-9_]+ '@') 0..1 <ResultName>
44
48
  end
45
49
 
46
50
  rule commands
@@ -1,3 +1,3 @@
1
1
  module Silicon
2
- VERSION = '0.4.0'.freeze
2
+ VERSION = '0.5.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: silicon
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
  - Vladimir Kalinkin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-09 00:00:00.000000000 Z
11
+ date: 2018-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hypo
@@ -245,6 +245,7 @@ files:
245
245
  - lib/silicon/routing/syntax/primitives/indent.rb
246
246
  - lib/silicon/routing/syntax/primitives/parameter.rb
247
247
  - lib/silicon/routing/syntax/primitives/path.rb
248
+ - lib/silicon/routing/syntax/primitives/result_name.rb
248
249
  - lib/silicon/routing/syntax/respond.rb
249
250
  - lib/silicon/routing/syntax/route.rb
250
251
  - lib/silicon/routing/syntax/sections.rb