mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 19:42:50 -06:00
simple refactoring: use ActiveKey in PGF.Parse.getParseResult instead of plain pair of FId and LIndex
This commit is contained in:
@@ -158,11 +158,11 @@ recoveryStates open_types (EState pgf cnc chart) =
|
|||||||
getParseResult :: ParseState -> Type -> (ParseResult,Maybe BracketedString)
|
getParseResult :: ParseState -> Type -> (ParseResult,Maybe BracketedString)
|
||||||
getParseResult (PState pgf cnc chart items) ty@(DTyp _ start _) =
|
getParseResult (PState pgf cnc chart items) ty@(DTyp _ start _) =
|
||||||
let mb_bs = case roots of
|
let mb_bs = case roots of
|
||||||
((root,lbl):_) -> Just $ linearizeWithBrackets $ Forest (abstract pgf) cnc (forest st) root lbl
|
((AK fid lbl):_) -> Just $ linearizeWithBrackets $ Forest (abstract pgf) cnc (forest st) fid lbl
|
||||||
_ -> Nothing
|
_ -> Nothing
|
||||||
|
|
||||||
exps = nubsort $ do
|
exps = nubsort $ do
|
||||||
(fid,lbl) <- roots
|
(AK fid lbl) <- roots
|
||||||
(fvs,e) <- go Set.empty 0 (0,fid)
|
(fvs,e) <- go Set.empty 0 (0,fid)
|
||||||
guard (Set.null fvs)
|
guard (Set.null fvs)
|
||||||
Right e1 <- [checkExpr pgf e ty]
|
Right e1 <- [checkExpr pgf e ty]
|
||||||
@@ -182,7 +182,7 @@ getParseResult (PState pgf cnc chart items) ty@(DTyp _ start _) =
|
|||||||
Just (CncCat s e lbls) -> do cat <- range (s,e)
|
Just (CncCat s e lbls) -> do cat <- range (s,e)
|
||||||
lbl <- indices lbls
|
lbl <- indices lbls
|
||||||
fid <- maybeToList (lookupPC (PK cat lbl 0) (passive st))
|
fid <- maybeToList (lookupPC (PK cat lbl 0) (passive st))
|
||||||
return (fid,lbl)
|
return (AK fid lbl)
|
||||||
Nothing -> mzero
|
Nothing -> mzero
|
||||||
|
|
||||||
go rec fcat' (d,fcat)
|
go rec fcat' (d,fcat)
|
||||||
|
|||||||
Reference in New Issue
Block a user