piggly 2.2.3 → 2.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/piggly/parser/grammar.tt +4 -5
- data/lib/piggly/version.rb +2 -2
- data/spec/examples/grammar/statements/exception_spec.rb +26 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f39e49434ecf4d819d325d757fa35296b0ef57d
|
4
|
+
data.tar.gz: 893b9a44543b794fb421ced51ccc82b0e3bf0b55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70dec8fb3d903f549acb6589e53990cf8cee42433de404dfe05cfcd06157d7f678b68e4d910e4ffc9cd8bc7a08336fc16ad251365aeacab40d08e6dcd2315991
|
7
|
+
data.tar.gz: e2936119f128db3bce6564a2edd02f5a8be06bab473d2b97c50481c9b5597effe2a8105c490f0f7015a5c7c40e8c5320f6e708ed5b352f07c07541f7aa7d374d
|
@@ -238,17 +238,16 @@ grammar Piggly
|
|
238
238
|
end
|
239
239
|
|
240
240
|
rule stmtRaise
|
241
|
-
bodyStub:stubNode
|
242
|
-
body:(kwRAISE tSpace level:kwEXCEPTION tSpace expr:expressionUntilSemiColon) ';' <Piggly::Parser::Nodes::Throw>
|
243
|
-
/
|
244
241
|
kwRAISE tSpace
|
245
242
|
level:( kwWARNING
|
246
243
|
/ kwNOTICE
|
247
244
|
/ kwINFO
|
248
245
|
/ kwLOG
|
249
246
|
/ kwDEBUG )
|
250
|
-
tSpace
|
251
|
-
|
247
|
+
( tSpace expr:expressionUntilSemiColon )? ';' <Piggly::Parser::Nodes::Raise>
|
248
|
+
/
|
249
|
+
bodyStub:stubNode
|
250
|
+
body:(kwRAISE ( tSpace level:kwEXCEPTION tSpace? )? expr:expressionUntilSemiColon) ';' <Piggly::Parser::Nodes::Throw>
|
252
251
|
end
|
253
252
|
|
254
253
|
rule stmtExecSql
|
data/lib/piggly/version.rb
CHANGED
@@ -25,6 +25,32 @@ module Piggly
|
|
25
25
|
node.count{|e| e.is_a?(Parser::Nodes::Raise) }.should == 1
|
26
26
|
end
|
27
27
|
end
|
28
|
+
|
29
|
+
it "doesn't require a message" do
|
30
|
+
node = parse(:statement, "RAISE EXCEPTION;")
|
31
|
+
node.count{|e| e.is_a?(Parser::Nodes::Throw) }.should == 1
|
32
|
+
node.count{|e| e.is_a?(Parser::Nodes::Raise) }.should == 0
|
33
|
+
end
|
34
|
+
|
35
|
+
it "doesn't require a message" do
|
36
|
+
%w(WARNING LOG INFO NOTICE DEBUG).each do |event|
|
37
|
+
node = parse(:statement, "RAISE #{event};")
|
38
|
+
node.count{|e| e.is_a?(Parser::Nodes::Throw) }.should == 0
|
39
|
+
node.count{|e| e.is_a?(Parser::Nodes::Raise) }.should == 1
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
it "has default level of EXCEPTION" do
|
44
|
+
node = parse(:statement, "RAISE 'message';")
|
45
|
+
node.count{|e| e.is_a?(Parser::Nodes::Throw) }.should == 1
|
46
|
+
node.count{|e| e.is_a?(Parser::Nodes::Raise) }.should == 0
|
47
|
+
end
|
48
|
+
|
49
|
+
it "doesn't require a level or message" do
|
50
|
+
node = parse(:statement, "RAISE;")
|
51
|
+
node.count{|e| e.is_a?(Parser::Nodes::Throw) }.should == 1
|
52
|
+
node.count{|e| e.is_a?(Parser::Nodes::Raise) }.should == 0
|
53
|
+
end
|
28
54
|
end
|
29
55
|
|
30
56
|
describe "catch" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: piggly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kvle Putnam
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: treetop
|