From: fred Date: Tue, 26 Mar 2002 21:29:17 +0000 (+0000) Subject: lilypond-1.1.5 X-Git-Tag: release/1.5.59~2770 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=c9646c2fc89c06ad697ab1587c28c7e6d1e41ab1;p=lilypond.git lilypond-1.1.5 --- diff --git a/init/declarations.ly b/init/declarations.ly index 352dc96a89..15573483f7 100644 --- a/init/declarations.ly +++ b/init/declarations.ly @@ -38,7 +38,7 @@ minor = 3 \include "property.ly" -\include "scm.ly" +\scmfile "lily.scm"; % music = "\melodic\relative c" diff --git a/init/scm.ly b/init/scm.ly index 1d45548295..e69de29bb2 100644 --- a/init/scm.ly +++ b/init/scm.ly @@ -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 - -\scm " -(primitive-load-path 'lily) -"; diff --git a/lib/include/simple-file-storage.hh b/lib/include/simple-file-storage.hh index 1fe0136c50..6df521ecd0 100644 --- a/lib/include/simple-file-storage.hh +++ b/lib/include/simple-file-storage.hh @@ -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); }; diff --git a/lily/include/lily-guile.hh b/lily/include/lily-guile.hh index a992a28fc1..5afbb1e6ce 100644 --- a/lily/include/lily-guile.hh +++ b/lily/include/lily-guile.hh @@ -31,6 +31,6 @@ SCM lambda_scm (String str, Array args_arr); SCM lambda_scm (String str, Array args_arr); - +void read_lily_scm_file (String); #endif // LILY_GUILE_HH diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index 6b1d186714..341c6d576c 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -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 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 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()); +} diff --git a/lily/parser.yy b/lily/parser.yy index 72e14708f5..e8779bce9d 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -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; }; diff --git a/mudela-mode.el b/mudela-mode.el index 2bbc8bbddc..ed33b67493 100644 --- a/mudela-mode.el +++ b/mudela-mode.el @@ -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" ))