~ubuntu-branches/debian/sid/polygen/sid

« back to all changes in this revision

Viewing changes to debian/patches/02-search-for-grammars.diff

  • Committer: Bazaar Package Importer
  • Author(s): Enrico Zini
  • Date: 2004-12-14 00:39:11 UTC
  • Revision ID: james.westby@ubuntu.com-20041214003911-cm8ljd1ir6cnunub
Tags: upstream-1.0.6
ImportĀ upstreamĀ versionĀ 1.0.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--- src/main.ml 2004-06-25 11:58:00.000000000 +0200
 
2
+++ src/main.ml 2004-11-23 19:44:14.000000000 +0100
 
3
@@ -119,6 +119,29 @@
 
4
         msg "preprocessing grammar...";
 
5
         Pre.pre decls0
 
6
 
 
7
+let find_grammar source =
 
8
+    if (Sys.file_exists(source)) then
 
9
+       source
 
10
+    else if (Sys.file_exists(source^".grm")) then
 
11
+       source^".grm"
 
12
+    else if (Sys.file_exists("/usr/share/polygen/"^source)) then
 
13
+        "/usr/share/polygen/"^source
 
14
+    else if (Sys.file_exists("/usr/share/polygen/"^source^".grm")) then
 
15
+        "/usr/share/polygen/"^source^".grm"
 
16
+    else if (Sys.file_exists("/usr/share/polygen/eng/"^source)) then
 
17
+        "/usr/share/polygen/eng/"^source
 
18
+    else if (Sys.file_exists("/usr/share/polygen/eng/"^source^".grm")) then
 
19
+        "/usr/share/polygen/eng/"^source^".grm"
 
20
+    else if (Sys.file_exists("/usr/share/polygen/fra/"^source)) then
 
21
+        "/usr/share/polygen/fra/"^source
 
22
+    else if (Sys.file_exists("/usr/share/polygen/fra/"^source^".grm")) then
 
23
+        "/usr/share/polygen/fra/"^source^".grm"
 
24
+    else if (Sys.file_exists("/usr/share/polygen/ita/"^source)) then
 
25
+        "/usr/share/polygen/ita/"^source
 
26
+    else if (Sys.file_exists("/usr/share/polygen/ita/"^source^".grm")) then
 
27
+        "/usr/share/polygen/ita/"^source^".grm"
 
28
+    else
 
29
+       source
 
30
 
 
31
 (* main *)
 
32
 
 
33
@@ -132,6 +155,9 @@
 
34
             fprintf !dest "%s\n" (Absyn1.pretty_decls "" (get_decls1 source))
 
35
 
 
36
       | Generate ->
 
37
+            let source = (find_grammar source)
 
38
+               in
 
39
+           
 
40
                (* load complied or source grammar *)
 
41
             let decls =
 
42
                try