Hi Oleg, That was fast ;-) The intention was to allow C++ namespace identifiers in foreign functions. But with this minimal extension, C++ namespaces identifiers are also allowed for ordinary identifiers. For a while, I wondered if it should be banned and I admit I don't have a firm opinion on the matter, so your thoughts are welcome. Regarding the patch for the _, yes it is better!
Yann Le mar. 13 sept. 2022 à 10:56, Oleg Nesterov <o...@redhat.com> a écrit : > Hello Yann and Stephane, > > I have some questions about the recent commit 1cf7b6d1b57 > ("Faust identifiers extended to accept c++ namespaces"). > > So, iiuc, with this patch I can use, say, ffunction(float, > std::sin(float)), > and this is nice. > > But this also allows "::" in the pure .dsp code, say > > a::b = 0; > process = a::b; > > Was it intentional? > > > But my main question is: why does faustlexer allow only a single > "_" in the identifiers? For example, > > process = ffunction(int __isnanf(float), "",""); > > or > __f = 0; > process = __f; > > can't be compiled. > > How about something like the patch below? > > Oleg. > --- > > diff --git a/compiler/parser/faustlexer.l b/compiler/parser/faustlexer.l > index 6d1ffb659..68b5aeea4 100644 > --- a/compiler/parser/faustlexer.l > +++ b/compiler/parser/faustlexer.l > @@ -230,8 +230,7 @@ NSID {ID}("::"{ID})* > > > "::"{NSID} return IDENT; > -_{NSID} return IDENT; > -{NSID} return IDENT; > +_*{NSID} return IDENT; > > "\""[^\"]*"\"" return STRING; > > >
_______________________________________________ Faudiostream-devel mailing list Faudiostream-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/faudiostream-devel