Parse a sort clause (sans header byte). This is used for blr_sort, blr_project and blr_group_by.
| 1487 | |
| 1488 | // Parse a sort clause (sans header byte). This is used for blr_sort, blr_project and blr_group_by. |
| 1489 | SortNode* PAR_sort(thread_db* tdbb, CompilerScratch* csb, UCHAR expectedBlr, |
| 1490 | bool nullForEmpty) |
| 1491 | { |
| 1492 | SET_TDBB(tdbb); |
| 1493 | |
| 1494 | const UCHAR blrOp = csb->csb_blr_reader.getByte(); |
| 1495 | |
| 1496 | if (blrOp != expectedBlr) |
| 1497 | { |
| 1498 | char s[20]; |
| 1499 | sprintf(s, "blr code %d", expectedBlr); |
| 1500 | PAR_syntax_error(csb, s); |
| 1501 | } |
| 1502 | |
| 1503 | USHORT count = csb->csb_blr_reader.getByte(); |
| 1504 | |
| 1505 | if (count == 0 && nullForEmpty) |
| 1506 | return NULL; |
| 1507 | |
| 1508 | SortNode* sort = PAR_sort_internal(tdbb, csb, blrOp == blr_sort, count); |
| 1509 | |
| 1510 | if (blrOp != blr_sort) |
| 1511 | sort->unique = true; |
| 1512 | |
| 1513 | return sort; |
| 1514 | } |
| 1515 | |
| 1516 | |
| 1517 | // Parse the internals of a sort clause. This is used for blr_sort, blr_project, blr_group_by |
no test coverage detected