mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 19:42:50 -06:00
Regenerated ParGF.y with current BNFC, and regenerated ParGF.hs with Happy 1.17. This seems to fix some of the less informative parsing error messages.
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -1,9 +1,11 @@
|
|||||||
-- This Happy file was machine-generated by the BNF converter
|
-- This Happy file was machine-generated by the BNF converter
|
||||||
{
|
{
|
||||||
module ParGF where
|
{-# OPTIONS -fno-warn-incomplete-patterns -fno-warn-overlapping-patterns #-}
|
||||||
import AbsGF
|
module GF.Source.ParGF where --H
|
||||||
import LexGF
|
import GF.Source.AbsGF --H
|
||||||
import ErrM
|
import GF.Source.LexGF --H
|
||||||
|
import GF.Infra.Ident --H
|
||||||
|
import GF.Data.ErrM --H
|
||||||
}
|
}
|
||||||
|
|
||||||
%name pGrammar Grammar
|
%name pGrammar Grammar
|
||||||
@@ -102,7 +104,7 @@ L_err { _ }
|
|||||||
|
|
||||||
%%
|
%%
|
||||||
|
|
||||||
Ident :: { Ident } : L_ident { Ident $1 }
|
Ident :: { Ident } : L_ident { identC $1 } --H
|
||||||
Integer :: { Integer } : L_integ { (read $1) :: Integer }
|
Integer :: { Integer } : L_integ { (read $1) :: Integer }
|
||||||
String :: { String } : L_quoted { $1 }
|
String :: { String } : L_quoted { $1 }
|
||||||
Double :: { Double } : L_doubl { (read $1) :: Double }
|
Double :: { Double } : L_doubl { (read $1) :: Double }
|
||||||
@@ -158,8 +160,11 @@ ModType : 'abstract' Ident { MTAbstract $2 }
|
|||||||
|
|
||||||
ModBody :: { ModBody }
|
ModBody :: { ModBody }
|
||||||
ModBody : Extend Opens '{' ListTopDef '}' { MBody $1 $2 (reverse $4) }
|
ModBody : Extend Opens '{' ListTopDef '}' { MBody $1 $2 (reverse $4) }
|
||||||
| Ident 'with' ListOpen { MWith $1 $3 }
|
| ListIncluded { MNoBody $1 }
|
||||||
| ListIncluded '**' Ident 'with' ListOpen { MWithE $1 $3 $5 }
|
| Included 'with' ListOpen { MWith $1 $3 }
|
||||||
|
| Included 'with' ListOpen '**' Opens '{' ListTopDef '}' { MWithBody $1 $3 $5 (reverse $7) }
|
||||||
|
| ListIncluded '**' Included 'with' ListOpen { MWithE $1 $3 $5 }
|
||||||
|
| ListIncluded '**' Included 'with' ListOpen '**' Opens '{' ListTopDef '}' { MWithEBody $1 $3 $5 $7 (reverse $9) }
|
||||||
| 'reuse' Ident { MReuse $2 }
|
| 'reuse' Ident { MReuse $2 }
|
||||||
| 'union' ListIncluded { MUnion $2 }
|
| 'union' ListIncluded { MUnion $2 }
|
||||||
|
|
||||||
@@ -603,7 +608,11 @@ thenM = (>>=)
|
|||||||
|
|
||||||
happyError :: [Token] -> Err a
|
happyError :: [Token] -> Err a
|
||||||
happyError ts =
|
happyError ts =
|
||||||
Bad $ "syntax error at " ++ tokenPos ts ++ if null ts then [] else (" before " ++ unwords (map prToken (take 4 ts)))
|
Bad $ "syntax error at " ++ tokenPos ts ++
|
||||||
|
case ts of
|
||||||
|
[] -> []
|
||||||
|
[Err _] -> " due to lexer error"
|
||||||
|
_ -> " before " ++ unwords (map prToken (take 4 ts))
|
||||||
|
|
||||||
myLexer = tokens
|
myLexer = tokens
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user