2020-01-28 10:18:45 +08:00
|
|
|
//===-- runtime/format.cpp --------------------------------------*- C++ -*-===//
|
2020-01-10 00:10:57 +08:00
|
|
|
//
|
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2020-02-05 08:55:45 +08:00
|
|
|
#include "format-implementation.h"
|
2020-01-10 00:10:57 +08:00
|
|
|
|
2020-01-17 05:51:25 +08:00
|
|
|
namespace Fortran::runtime::io {
|
|
|
|
|
2020-02-05 08:55:45 +08:00
|
|
|
DataEdit DefaultFormatControlCallbacks::GetNextDataEdit(int) {
|
|
|
|
Crash("DefaultFormatControlCallbacks::GetNextDataEdit() called for "
|
|
|
|
"non-formatted I/O statement");
|
|
|
|
return {};
|
|
|
|
}
|
2020-07-22 08:37:35 +08:00
|
|
|
bool DefaultFormatControlCallbacks::Emit(
|
|
|
|
const char *, std::size_t, std::size_t) {
|
2020-02-05 08:55:45 +08:00
|
|
|
Crash("DefaultFormatControlCallbacks::Emit(char) called for non-output I/O "
|
|
|
|
"statement");
|
|
|
|
return {};
|
|
|
|
}
|
|
|
|
bool DefaultFormatControlCallbacks::Emit(const char16_t *, std::size_t) {
|
|
|
|
Crash("DefaultFormatControlCallbacks::Emit(char16_t) called for non-output "
|
|
|
|
"I/O statement");
|
|
|
|
return {};
|
|
|
|
}
|
|
|
|
bool DefaultFormatControlCallbacks::Emit(const char32_t *, std::size_t) {
|
|
|
|
Crash("DefaultFormatControlCallbacks::Emit(char32_t) called for non-output "
|
|
|
|
"I/O statement");
|
|
|
|
return {};
|
|
|
|
}
|
2020-02-14 06:41:56 +08:00
|
|
|
std::optional<char32_t> DefaultFormatControlCallbacks::GetCurrentChar() {
|
|
|
|
Crash("DefaultFormatControlCallbacks::GetCurrentChar() called for non-input "
|
|
|
|
"I/O "
|
|
|
|
"statement");
|
|
|
|
return {};
|
|
|
|
}
|
2020-02-05 08:55:45 +08:00
|
|
|
bool DefaultFormatControlCallbacks::AdvanceRecord(int) {
|
|
|
|
Crash("DefaultFormatControlCallbacks::AdvanceRecord() called unexpectedly");
|
|
|
|
return {};
|
|
|
|
}
|
2020-02-14 06:41:56 +08:00
|
|
|
void DefaultFormatControlCallbacks::BackspaceRecord() {
|
|
|
|
Crash("DefaultFormatControlCallbacks::BackspaceRecord() called unexpectedly");
|
|
|
|
}
|
|
|
|
void DefaultFormatControlCallbacks::HandleAbsolutePosition(std::int64_t) {
|
2020-02-05 08:55:45 +08:00
|
|
|
Crash("DefaultFormatControlCallbacks::HandleAbsolutePosition() called for "
|
2020-02-14 06:41:56 +08:00
|
|
|
"non-formatted I/O statement");
|
2020-02-05 08:55:45 +08:00
|
|
|
}
|
2020-02-14 06:41:56 +08:00
|
|
|
void DefaultFormatControlCallbacks::HandleRelativePosition(std::int64_t) {
|
2020-02-05 08:55:45 +08:00
|
|
|
Crash("DefaultFormatControlCallbacks::HandleRelativePosition() called for "
|
2020-02-14 06:41:56 +08:00
|
|
|
"non-formatted I/O statement");
|
2020-02-05 08:55:45 +08:00
|
|
|
}
|
|
|
|
|
2020-02-14 06:41:56 +08:00
|
|
|
template class FormatControl<
|
|
|
|
InternalFormattedIoStatementState<Direction::Output>>;
|
|
|
|
template class FormatControl<
|
|
|
|
InternalFormattedIoStatementState<Direction::Input>>;
|
|
|
|
template class FormatControl<
|
|
|
|
ExternalFormattedIoStatementState<Direction::Output>>;
|
|
|
|
template class FormatControl<
|
|
|
|
ExternalFormattedIoStatementState<Direction::Input>>;
|
2020-03-29 12:00:16 +08:00
|
|
|
} // namespace Fortran::runtime::io
|