fsprojects / FsLexYacc

Lexer and parser generators for F#
http://fsprojects.github.io/FsLexYacc/
MIT License
207 stars 69 forks source link

Generate signature files for lex files. #170

Closed nojaf closed 1 year ago

nojaf commented 1 year ago

I would like to have signature files for *.fsl files as well.

See the example at https://github.com/dotnet/fsharp/pull/15182.

I've made the following changes:

The assumption now is that each rule does return a token type, which does seem to be the case in the compiler.

dsyme commented 1 year ago

The assumption now is that each rule does return a token type, which does seem to be the case in the compiler.

Could you clarify this please, e.g. link to the relevant line where this assumption is made? It's not always necessaryily the case that there's a token type when using fslex.

nojaf commented 1 year ago

@dsyme right now every *.fslreturns a token type (defined in the *.fsy counterpart).

Example: https://github.com/dotnet/fsharp/blob/97651b3456a7fa23369e189e1365cb38490e2d23/src/Compiler/lex.fsl#L345-L359

Alternatively, an actual return type should be allowed for a rule as well in the grammar.

dsyme commented 1 year ago

@dsyme right now every .fslreturns a token type (defined in the .fsy counterpart).

OK, well, I guess it's OK :)