brintos

brintos / llvm-project-archived public Read only

0
0
Text · 703 B · 439e9fb Raw
25 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8 9#include "flang/Parser/char-set.h"10 11namespace Fortran::parser {12 13std::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;20    }21  }22  return result;23}24} // namespace Fortran::parser25