Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / lib / Parser / char-set.cpp
blob439e9fbff3a8f6ccde9eccbd565e654324c6a175
1 //===-- lib/Parser/char-set.cpp -------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #include "flang/Parser/char-set.h"
11 namespace Fortran::parser {
13 std::string SetOfChars::ToString() const {
14 std::string result;
15 SetOfChars set{*this};
16 for (char ch{' '}; !set.empty(); ++ch) {
17 if (set.Has(ch)) {
18 set = set.Difference(ch);
19 result += ch;
22 return result;
24 } // namespace Fortran::parser