lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Updated parser patch


From: Erik Sandberg
Subject: Re: Updated parser patch
Date: Mon, 29 May 2006 13:34:36 +0200

On 5/29/06, Han-Wen Nienhuys <address@hidden> wrote:
Erik Sandberg schreef:
> +LY_DEFINE (ly_parser_error, "ly:parser-error",
> +        2, 1, 0, (SCM parser, SCM msg, SCM input),
> +        "Display an error message, and make the parser fail")
> +{
> +  Lily_parser *p = unsmob_lily_parser (parser);
> +  SCM_ASSERT_TYPE (p, parser, SCM_ARG1, __FUNCTION__, "Lilypond parser");
> +  SCM_ASSERT_TYPE (scm_is_string (msg), msg, SCM_ARG2, __FUNCTION__, 
"string");
> +  string s = ly_scm2string (msg);
> +
> +  Input *i = unsmob_input (input);
> +  if (i)
> +    p->parser_error (*i, s);
> +  else
> +    p->parser_error (s);
>
> +  return parser;
> +}

Can you make it accept arbitrary arguments in the spirit of (format ..)?
you will have to change argument order, of course.

Hm, then input has to be non-optional. Why not just let the caller use _?

Erik




reply via email to

[Prev in Thread] Current Thread [Next in Thread]