[all-commits] [llvm/llvm-project] fa9b23: [flang][Parser] Convert applyMem to invoke non-voi...

Krzysztof Parzyszek via All-commits all-commits at lists.llvm.org
Thu Dec 12 14:13:59 PST 2024


  Branch: refs/heads/users/kparzysz/spr/m01-applymem
  Home:   https://github.com/llvm/llvm-project
  Commit: fa9b23d9bd669f2447b1594ec845752ff84dad1b
      https://github.com/llvm/llvm-project/commit/fa9b23d9bd669f2447b1594ec845752ff84dad1b
  Author: Krzysztof Parzyszek <Krzysztof.Parzyszek at amd.com>
  Date:   2024-12-12 (Thu, 12 Dec 2024)

  Changed paths:
    M flang/docs/ParserCombinators.md
    M flang/lib/Parser/basic-parsers.h

  Log Message:
  -----------
  [flang][Parser] Convert applyMem to invoke non-void members

Currently applyMem(f, a, ...) calls a.f(...), but still returns the
result of parser a. This is in contrast to applyFunction(f, a, ...),
which returns the result of calling f(a, ...).

The use case for this is being able to parse quoted or unquoted
strings, and store the result as std::string:

```
construct<IdentifierOrString>(
  (space >> charLiteralConstantWithoutKind) ||
  applyMem(&Name::ToString, Parser<Name>{})) // Parser<Name>{}.ToString()
```

The applyMem combinator is currently unused.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list