Skip to content

Commit fa48c9f

Browse files
committed
[add] Conflice 発生時に詳細を表示するようにした
1 parent f3b7e8b commit fa48c9f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/copager2/src/Copager2/Parse/Common/First.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ first :: (TokenSet ts, RuleSet ts rs)
5555
first _ (EOF:_) = [EOF]
5656
first _ (t@(Term _):_) = [t]
5757

58-
-- -- -- 非終端記号から始まる n 文字
58+
-- 非終端記号から始まる n 文字
5959
first firstSet (Epsilon:xs) = first firstSet xs
6060
first firstSet (NonTerm x:xs) =
6161
let firstX = HashSet.toList $ firstSet HashMap.! NonTerm x

lib/copager2/src/Copager2/Parse/LR/Common/Table.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,12 @@ tryMarkRow row act = do
108108
in tables { action = action', eof_action = eof_action' }
109109
return ()
110110

111-
tryInsert :: (Hashable a, TokenSet ts, RuleSet ts rs)
111+
tryInsert :: (Show a, Hashable a, TokenSet ts, RuleSet ts rs)
112112
=> a
113113
-> LRAction rs
114114
-> HashMap a (LRAction rs)
115115
-> HashMap a (LRAction rs)
116116
tryInsert key act table =
117117
case table !? key of
118-
Just _ -> error "conflict"
118+
Just act' -> error $ "conflict : " ++ show (key, act', act)
119119
Nothing -> insert key act table

0 commit comments

Comments
 (0)