LEFT | RIGHT |
1 /* | 1 /* |
2 This file is part of LilyPond, the GNU music typesetter. | 2 This file is part of LilyPond, the GNU music typesetter. |
3 | 3 |
4 Copyright (C) 2004--2020 Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 Copyright (C) 2004--2020 Han-Wen Nienhuys <hanwen@xs4all.nl> |
5 | 5 |
6 LilyPond is free software: you can redistribute it and/or modify | 6 LilyPond is free software: you can redistribute it and/or modify |
7 it under the terms of the GNU General Public License as published by | 7 it under the terms of the GNU General Public License as published by |
8 the Free Software Foundation, either version 3 of the License, or | 8 the Free Software Foundation, either version 3 of the License, or |
9 (at your option) any later version. | 9 (at your option) any later version. |
10 | 10 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 const Input &start = ps->start_; | 79 const Input &start = ps->start_; |
80 ssize_t line_number, line_char, column, line_byte_offset; | 80 ssize_t line_number, line_char, column, line_byte_offset; |
81 start.get_counts (&line_number, &line_char, &column, &line_byte_offset); | 81 start.get_counts (&line_number, &line_char, &column, &line_byte_offset); |
82 | 82 |
83 ssize_t byte_offset = start.start () - start.get_source_file ()->c_str (); | 83 ssize_t byte_offset = start.start () - start.get_source_file ()->c_str (); |
84 Overlay_string_port overlay ( | 84 Overlay_string_port overlay ( |
85 start.start (), start.get_source_file ()->length () - byte_offset); | 85 start.start (), start.get_source_file ()->length () - byte_offset); |
86 | 86 |
87 SCM port = overlay.as_port (); | 87 SCM port = overlay.as_port (); |
88 scm_set_port_line_x (port, scm_from_ssize_t (line_number - 1)); | 88 scm_set_port_line_x (port, scm_from_ssize_t (line_number - 1)); |
89 | 89 scm_set_port_filename_x ( |
| 90 port, ly_string2scm (start.get_source_file ()->name_string ().c_str ())); |
90 // TODO: Do GUILE ports count in characters or bytes? Do they do tab | 91 // TODO: Do GUILE ports count in characters or bytes? Do they do tab |
91 // expansion for column counts? | 92 // expansion for column counts? |
92 scm_set_port_column_x (port, scm_from_ssize_t (column - 1)); | 93 scm_set_port_column_x (port, scm_from_ssize_t (column - 1)); |
93 | 94 |
94 bool multiple = '@' == *ps->start_.start (); | 95 bool multiple = '@' == *ps->start_.start (); |
95 if (multiple) | 96 if (multiple) |
96 (void) scm_read_char (port); | 97 (void) scm_read_char (port); |
97 | 98 |
98 SCM form = scm_read (port); | 99 SCM form = scm_read (port); |
99 ssize_t consumed = scm_to_ssize_t (scm_ftell (port)); | 100 ssize_t consumed = scm_to_ssize_t (scm_ftell (port)); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 | 197 |
197 SCM ans = scm_c_with_fluid | 198 SCM ans = scm_c_with_fluid |
198 (Lily::f_location, | 199 (Lily::f_location, |
199 ps.parsed_.smobbed_copy (), | 200 ps.parsed_.smobbed_copy (), |
200 parse_protect_global ? protected_evaluate_scheme_form | 201 parse_protect_global ? protected_evaluate_scheme_form |
201 : evaluate_scheme_form_void, (void *) &ps); | 202 : evaluate_scheme_form_void, (void *) &ps); |
202 | 203 |
203 scm_remember_upto_here_1 (form); | 204 scm_remember_upto_here_1 (form); |
204 return ans; | 205 return ans; |
205 } | 206 } |
LEFT | RIGHT |