]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.1.5
authorfred <fred>
Tue, 26 Mar 2002 21:29:17 +0000 (21:29 +0000)
committerfred <fred>
Tue, 26 Mar 2002 21:29:17 +0000 (21:29 +0000)
init/declarations.ly
init/scm.ly
lib/include/simple-file-storage.hh
lily/include/lily-guile.hh
lily/lily-guile.cc
lily/parser.yy
mudela-mode.el

index 352dc96a890ceefe08562e69994201c42ae314fa..15573483f78349327d723d2dc1b93556ed8327c2 100644 (file)
@@ -38,7 +38,7 @@ minor = 3
 
 \include "property.ly"
 
-\include "scm.ly"
+\scmfile "lily.scm";
 
 % music = "\melodic\relative c"
 
index 1d455482954d4391e7309aaa99dc677453e881af..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,9 +0,0 @@
-% scm.ly -- implement Scheme output routines for TeX and PostScript
-%
-%  source file of the GNU LilyPond music typesetter
-% 
-% (c) 1998 Jan Nieuwenhuizen <janneke@gnu.org>
-
-\scm "
-(primitive-load-path 'lily)
-";
index 1fe0136c508627b9c950e3ffe440b8d6fbc02385..6df521ecd05b2d98671fafde8327de4d5318466d 100644 (file)
@@ -22,11 +22,10 @@ class Simple_file_storage  : public File_storage
 
   void load_stdin ();
   void load_file (String);
-protected:    
+public:
   virtual char const*ch_C () const;
   virtual int length_i () const;
   virtual ~Simple_file_storage ();
-public:
   Simple_file_storage (String);
 };
 
index a992a28fc1de85c6ae449d3c1a7d582a867a66fc..5afbb1e6cefbe705e3f6d74baaae879796d762d8 100644 (file)
@@ -31,6 +31,6 @@ SCM lambda_scm (String str, Array<Real> args_arr);
 SCM lambda_scm (String str, Array<Scalar> args_arr);
 
 
-
+void read_lily_scm_file (String);
 
 #endif // LILY_GUILE_HH
index 6b1d186714bdf72006b83ed3be838dc2ec6f3273..341c6d576cf3fd82d4abc24a40dc42d671c3b606 100644 (file)
@@ -12,6 +12,8 @@
 #include "libc-extension.hh"
 #include "lily-guile.hh"
 #include "main.hh"
+#include "simple-file-storage.hh"
+#include "file-path.hh"
 
 SCM
 ly_append (SCM a, SCM b)
@@ -22,7 +24,7 @@ ly_append (SCM a, SCM b)
 SCM
 ly_list1 (SCM a)
 {
-  return gh_call1 (gh_eval_str ("list"), a);
+  return gh_list (a, SCM_UNDEFINED);
 }
 
 SCM
@@ -101,8 +103,9 @@ lambda_scm (String str, Array<Real> args_arr)
       args_arr.clear ();
     }
   SCM args_scm = SCM_EOL;
-  for (int i = args_arr.size () - 1; i >= 0; i--)
+  for (int i = args_arr.size (); i--; )
     args_scm = gh_cons (gh_double2scm (args_arr[i]), args_scm);
+  
   SCM scm =
     ly_append (ly_lambda_o (), 
     ly_list1 (ly_append (ly_func_o (str.ch_l ()), args_scm)));
@@ -110,3 +113,12 @@ lambda_scm (String str, Array<Real> args_arr)
 }
 
 
+
+void
+read_lily_scm_file (String fn)
+{
+  String s = global_path.find (fn);
+  Simple_file_storage f(s);
+  
+  gh_eval_str (f.ch_C());
+}
index 72e14708f53db987b0d596d2ad7d33a80053f7ca..e8779bce9dcc1f0c2106266ff04109661fce4df4 100644 (file)
@@ -193,7 +193,8 @@ yylex (YYSTYPE *s,  void * v_l)
 %token PT_T
 %token RELATIVE
 %token REMOVE
-%token SCHEME /* token vs typedef;  can't be named SCM */
+%token SCM_T
+%token SCMFILE
 %token SCORE
 %token SCRIPT
 %token SHAPE
@@ -326,10 +327,12 @@ toplevel_expression:
        ;
 
 embedded_scm:
-       SCHEME STRING ';' {
-       #ifdef HAVE_LIBGUILE
+       SCMFILE STRING ';' {
+               read_lily_scm_file (*$2);
+               delete $2;
+       }
+       | SCM_T STRING ';' {
                gh_eval_str ($2->ch_l ());
-       #endif
                delete $2;
        };
 
index 2bbc8bbddc35a8a9a2f768aba18d3d87a3d36c64..ed33b674933a6b969bd83dd1230f155e183eafc8 100644 (file)
@@ -38,6 +38,7 @@
                     "musical_pitch" "time" "midi" "mm" "header"
                     "notenames" "octave" "output" "partial" "paper" "plet"
                     "property" "pt" "shape" "relative" "include" "score"
+                    "scm" "scmfile"
                     "script" "skip"  "table" "spandynamic" "symboltables"
                     "tempo" "texid" "textstyle" "transpose" "version" "grouping"
                     ))