summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Grammar/EBNF.hs
diff options
context:
space:
mode:
authorkr.angelov <kr.angelov@gmail.com>2011-11-02 11:44:59 +0000
committerkr.angelov <kr.angelov@gmail.com>2011-11-02 11:44:59 +0000
commit5fe49ed9f7ac7089301e867e55bfedefcba230dd (patch)
tree3d49a4fbd3e3af5350b4e276d65ec3c17f0907c3 /src/compiler/GF/Grammar/EBNF.hs
parent42af63414fae6cec2ea6d648464f9475501b2b28 (diff)
Now the compiler maintains more precise information for the source locations of the different definitions. There is a --tags option which generates a list of all identifiers with their source locations.
Diffstat (limited to 'src/compiler/GF/Grammar/EBNF.hs')
-rw-r--r--src/compiler/GF/Grammar/EBNF.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/compiler/GF/Grammar/EBNF.hs b/src/compiler/GF/Grammar/EBNF.hs
index 11a2b3c4b..e5cbf6c7f 100644
--- a/src/compiler/GF/Grammar/EBNF.hs
+++ b/src/compiler/GF/Grammar/EBNF.hs
@@ -24,13 +24,14 @@ import GF.Grammar.Grammar
import Data.Char
import Data.List
+import System.FilePath
-- AR 18/4/2000 - 31/3/2004
-getEBNF :: String -> String -> Err SourceGrammar
-getEBNF name = fmap (cf2gf name . ebnf2cf) . pEBNF
+getEBNF :: FilePath -> String -> Err SourceGrammar
+getEBNF fpath = fmap (cf2gf fpath . ebnf2cf) . pEBNF
type EBNF = [ERule]
type ERule = (ECat, ERHS)
@@ -54,7 +55,7 @@ type CFJustRule = (CFCat, CFRHS)
ebnf2cf :: EBNF -> [CFRule]
ebnf2cf ebnf =
- [L (0,0) (mkCFF i rule,rule) | (i,rule) <- zip [0..] (normEBNF ebnf)] where
+ [L NoLoc (mkCFF i rule,rule) | (i,rule) <- zip [0..] (normEBNF ebnf)] where
mkCFF i (c, _) = ("Mk" ++ c ++ "_" ++ show i)
normEBNF :: EBNF -> [CFJustRule]