The AddColumnsStream, SortStream, and requisite yacc/lex grammar were originally added to a new branch, off of development, which is on net8. I forgot to change it to net7 when I cherry-picked the commits for the regular development branch. It's wasn't quite as simple as flipping net8 -> net7 in csproj files, because I was eager to use new language features only available in net8! Namely, primary constructors and collection expressions.
30 lines
705 B
Plaintext
30 lines
705 B
Plaintext
%namespace Bts.ColumnSortExpressions
|
|
%partial
|
|
%visibility internal
|
|
%tokentype ColumnSortExpressionToken
|
|
%parsertype ColumnSortExpressionParser
|
|
|
|
%union {
|
|
public string Identifier;
|
|
public ColumnSortExpression Column;
|
|
public ImmutableList<ColumnSortExpression> Columns;
|
|
}
|
|
|
|
%token ASCENDING, DESCENDING, IDENTIFIER
|
|
|
|
%type <Column> Column
|
|
%type <Columns> Columns
|
|
|
|
%%
|
|
|
|
Columns :
|
|
Column { $$ = ImmutableList.CreateRange(new[] { $1 }); }
|
|
| Columns Column { $$ = $1.Add($2); }
|
|
;
|
|
|
|
Column :
|
|
IDENTIFIER { $$ = new($1.Identifier, true); }
|
|
| ASCENDING IDENTIFIER { $$ = new($2.Identifier, true); }
|
|
| DESCENDING IDENTIFIER { $$ = new($2.Identifier, false); }
|
|
;
|