Lines Matching refs:io

17 namespace Fortran::runtime::io {  namespace
23 static inline char32_t GetComma(IoStatementState &io) { in GetComma() argument
24 return io.mutableModes().editingFlags & decimalComma ? char32_t{';'} in GetComma()
29 IoStatementState &io{*cookie}; in IONAME() local
30 io.CheckFormattedStmtType<Direction::Output>("OutputNamelist"); in IONAME()
31 io.mutableModes().inNamelist = true; in IONAME()
32 char comma{static_cast<char>(GetComma(io))}; in IONAME()
33 ConnectionState &connection{io.GetConnectionState()}; in IONAME()
36 return (!connection.NeedAdvance(1) || io.AdvanceRecord()) && in IONAME()
37 io.Emit(&ch, 1); in IONAME()
41 !(io.AdvanceRecord() && io.Emit(" ", 1))) { in IONAME()
47 if (!io.Emit(&up, 1)) { in IONAME()
57 auto *listOutput{io.get_if<ListDirectedStatementState<Direction::Output>>()}; in IONAME()
66 descr::DescriptorIO<Direction::Output>(io, item.descriptor))) { in IONAME()
88 IoStatementState &io, char buffer[], std::size_t maxLength) { in GetLowerCaseName() argument
90 if (auto ch{io.GetNextNonBlank(byteLength)}) { in GetLowerCaseName()
95 io.HandleRelativePosition(byteLength); in GetLowerCaseName()
96 ch = io.GetCurrentChar(byteLength); in GetLowerCaseName()
102 io.GetIoErrorHandler().SignalError( in GetLowerCaseName()
109 static std::optional<SubscriptValue> GetSubscriptValue(IoStatementState &io) { in GetSubscriptValue() argument
112 std::optional<char32_t> ch{io.GetCurrentChar(byteCount)}; in GetSubscriptValue()
115 io.HandleRelativePosition(byteCount); in GetSubscriptValue()
116 ch = io.GetCurrentChar(byteCount); in GetSubscriptValue()
123 io.HandleRelativePosition(byteCount); in GetSubscriptValue()
124 ch = io.GetCurrentChar(byteCount); in GetSubscriptValue()
127 io.GetIoErrorHandler().SignalError( in GetSubscriptValue()
135 io.HandleRelativePosition(-byteCount); // give back '-' with no digits in GetSubscriptValue()
141 static bool HandleSubscripts(IoStatementState &io, Descriptor &desc, in HandleSubscripts() argument
143 IoErrorHandler &handler{io.GetIoErrorHandler()}; in HandleSubscripts()
144 io.HandleRelativePosition(1); // skip '(' in HandleSubscripts()
152 std::optional<char32_t> ch{io.GetNextNonBlank(byteCount)}; in HandleSubscripts()
153 char32_t comma{GetComma(io)}; in HandleSubscripts()
169 if (auto low{GetSubscriptValue(io)}) { in HandleSubscripts()
182 ch = io.GetNextNonBlank(byteCount); in HandleSubscripts()
185 io.HandleRelativePosition(byteCount); in HandleSubscripts()
186 ch = io.GetNextNonBlank(byteCount); in HandleSubscripts()
187 if (auto high{GetSubscriptValue(io)}) { in HandleSubscripts()
200 ch = io.GetNextNonBlank(byteCount); in HandleSubscripts()
203 io.HandleRelativePosition(byteCount); in HandleSubscripts()
204 ch = io.GetNextNonBlank(byteCount); in HandleSubscripts()
205 if (auto str{GetSubscriptValue(io)}) { in HandleSubscripts()
207 ch = io.GetNextNonBlank(byteCount); in HandleSubscripts()
215 io.HandleRelativePosition(byteCount); in HandleSubscripts()
216 ch = io.GetNextNonBlank(byteCount); in HandleSubscripts()
226 io.HandleRelativePosition(byteCount); in HandleSubscripts()
243 IoStatementState &io, Descriptor &desc, const char *name) { in HandleSubstring() argument
244 IoErrorHandler &handler{io.GetIoErrorHandler()}; in HandleSubstring()
254 io.HandleRelativePosition(1); // skip '(' in HandleSubstring()
257 std::optional<char32_t> ch{io.GetNextNonBlank(byteCount)}; in HandleSubstring()
262 lower = GetSubscriptValue(io); in HandleSubstring()
263 ch = io.GetNextNonBlank(byteCount); in HandleSubstring()
267 io.HandleRelativePosition(byteCount); in HandleSubstring()
268 ch = io.GetNextNonBlank(byteCount); in HandleSubstring()
273 upper = GetSubscriptValue(io); in HandleSubstring()
274 ch = io.GetNextNonBlank(byteCount); in HandleSubstring()
279 io.HandleRelativePosition(byteCount); in HandleSubstring()
304 static bool HandleComponent(IoStatementState &io, Descriptor &desc, in HandleComponent() argument
306 IoErrorHandler &handler{io.GetIoErrorHandler()}; in HandleComponent()
307 io.HandleRelativePosition(1); // skip '%' in HandleComponent()
309 if (GetLowerCaseName(io, compName, sizeof compName)) { in HandleComponent()
341 static void SkipNamelistGroup(IoStatementState &io) { in SkipNamelistGroup() argument
343 while (auto ch{io.GetNextNonBlank(byteCount)}) { in SkipNamelistGroup()
344 io.HandleRelativePosition(byteCount); in SkipNamelistGroup()
351 if ((ch = io.GetCurrentChar(byteCount))) { in SkipNamelistGroup()
352 io.HandleRelativePosition(byteCount); in SkipNamelistGroup()
356 } else if (!io.AdvanceRecord()) { in SkipNamelistGroup()
365 IoStatementState &io{*cookie}; in IONAME() local
366 io.CheckFormattedStmtType<Direction::Input>("InputNamelist"); in IONAME()
367 io.mutableModes().inNamelist = true; in IONAME()
368 IoErrorHandler &handler{io.GetIoErrorHandler()}; in IONAME()
369 auto *listInput{io.get_if<ListDirectedStatementState<Direction::Input>>()}; in IONAME()
372 io.BeginReadingRecord(); in IONAME()
376 char32_t comma{GetComma(io)}; in IONAME()
379 next = io.GetNextNonBlank(byteCount); in IONAME()
382 if (!io.AdvanceRecord()) { in IONAME()
385 next = io.GetNextNonBlank(byteCount); in IONAME()
393 io.HandleRelativePosition(byteCount); in IONAME()
394 if (!GetLowerCaseName(io, name, sizeof name)) { in IONAME()
401 SkipNamelistGroup(io); in IONAME()
405 next = io.GetNextNonBlank(byteCount); in IONAME()
409 if (!GetLowerCaseName(io, name, sizeof name)) { in IONAME()
432 next = io.GetCurrentChar(byteCount); in IONAME()
443 if (!HandleSubstring(io, mutableDescriptor, name)) { in IONAME()
453 io, mutableDescriptor, *useDescriptor, name)) { in IONAME()
458 if (!HandleComponent(io, mutableDescriptor, *useDescriptor, name)) { in IONAME()
465 next = io.GetCurrentChar(byteCount); in IONAME()
469 next = io.GetNextNonBlank(byteCount); in IONAME()
475 io.HandleRelativePosition(byteCount); in IONAME()
478 if (!descr::DescriptorIO<Direction::Input>(io, *useDescriptor)) { in IONAME()
481 next = io.GetNextNonBlank(byteCount); in IONAME()
483 io.HandleRelativePosition(byteCount); in IONAME()
491 io.HandleRelativePosition(1); in IONAME()
495 bool IsNamelistName(IoStatementState &io) { in IsNamelistName() argument
496 if (io.get_if<ListDirectedStatementState<Direction::Input>>()) { in IsNamelistName()
497 if (io.mutableModes().inNamelist) { in IsNamelistName()
498 SavedPosition savedPosition{io}; in IsNamelistName()
500 if (auto ch{io.GetNextNonBlank(byteCount)}) { in IsNamelistName()
503 io.HandleRelativePosition(byteCount); in IsNamelistName()
504 ch = io.GetCurrentChar(byteCount); in IsNamelistName()
506 ch = io.GetNextNonBlank(byteCount); in IsNamelistName()