Skip to content
This repository was archived by the owner on May 3, 2021. It is now read-only.

Commit 46ac708

Browse files
committed
Add exhaustive check
1 parent 4594e2d commit 46ac708

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

examples/json/helpers.cr

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class JSONActions < Marpa::Actions
1515

1616
body = body.gsub("\\'", "'")
1717
body = body.gsub("\\\"", "\"")
18-
body = body.gsub("\\\/", "\/")
18+
body = body.gsub("\\/", "/")
1919
body = body.gsub("\\\\", "\\")
2020
body = body.gsub("\\n", "\n")
2121
body = body.gsub("\\r", "\r")

shard.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ description: |
1010
libraries:
1111
libmarpa: ~> 8.6.0
1212

13-
crystal: 0.31.0
13+
crystal: 0.34.0
1414

1515
license: GPLv3

src/marpa.cr

+7-1
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,8 @@ module Marpa
335335
when LibMarpa::MarpaStepType::MARPA_STEP_INACTIVE
336336
stack = stack[0]
337337
break
338-
when LibMarpa::MarpaStepType::MARPA_STEP_INITIAL
338+
else
339+
raise "Unimplemented step type #{step_type}"
339340
end
340341
end
341342

@@ -551,6 +552,7 @@ module Marpa
551552
else
552553
@tokens[lhs] = [rhs]
553554
end
555+
else nil # Ignore
554556
end
555557
end
556558

@@ -655,6 +657,7 @@ module Marpa
655657
else
656658
@tokens[lhs] = [[rhs]]
657659
end
660+
else nil # Ignore
658661
end
659662

660663
""
@@ -705,6 +708,7 @@ module Marpa
705708
pause = adverb[2].as(String)
706709
when "event"
707710
event = adverb[2].as(String)
711+
else nil # Ignore
708712
end
709713
end
710714

@@ -719,6 +723,7 @@ module Marpa
719723
when "after"
720724
lexeme["completion"] = event
721725
status = LibMarpa.marpa_g_symbol_is_completion_event_set(grammar, symbol_id, 1)
726+
else nil # Ignore
722727
end
723728

724729
@lexemes[symbol_id] = lexeme
@@ -778,6 +783,7 @@ module Marpa
778783
options = options | Regex::Options::MULTILINE
779784
when "x"
780785
options = options | Regex::Options::EXTENDED
786+
else nil # Ignore
781787
end
782788
end
783789

0 commit comments

Comments
 (0)