[flang] Allow dollar and backslash formats

Original-commit: flang-compiler/f18@4d8d6e599e
Reviewed-on: https://github.com/flang-compiler/f18/pull/352
Tree-same-pre-rewrite: false
This commit is contained in:
peter klausler 2019-03-21 16:47:51 -07:00
parent 5b0e18b0e4
commit 1d2a212c38
4 changed files with 16 additions and 6 deletions

View File

@ -669,7 +669,8 @@ R1311 e -> digit-string
R1312 v -> [sign] digit-string
R1313 control-edit-desc ->
position-edit-desc | [r] / | : | sign-edit-desc | k P |
blank-interp-edit-desc | round-edit-desc | decimal-edit-desc
blank-interp-edit-desc | round-edit-desc | decimal-edit-desc |
@ $ | \
R1314 k -> [sign] digit-string
R1315 position-edit-desc -> T n | TL n | TR n | n X
R1316 n -> digit-string

View File

@ -30,7 +30,7 @@ ENUM_CLASS(LanguageFeature, BackslashEscapes, OldDebugLines,
Convert, Dispose, IOListLeadingComma, AbbreviatedEditDescriptor,
ProgramParentheses, PercentRefAndVal, OmitFunctionDummies, CrayPointer,
Hollerith, ArithmeticIF, Assign, AssignedGOTO, Pause, OpenMP,
CruftAfterAmpersand, ClassicCComments)
CruftAfterAmpersand, ClassicCComments, AdditionalFormats)
using LanguageFeatures =
common::EnumSet<LanguageFeature, LanguageFeature_enumSize>;

View File

@ -70,7 +70,8 @@ struct DerivedTypeDataEditDesc {
// R1313 control-edit-desc ->
// position-edit-desc | [r] / | : | sign-edit-desc | k P |
// blank-interp-edit-desc | round-edit-desc | decimal-edit-desc
// blank-interp-edit-desc | round-edit-desc | decimal-edit-desc |
// @ \ | $
// R1315 position-edit-desc -> T n | TL n | TR n | n X
// R1316 n -> digit-string
// R1317 sign-edit-desc -> SS | SP | S
@ -98,7 +99,9 @@ struct ControlEditDesc {
RC,
RP,
DC,
DP
DP,
Dollar,
Backslash,
};
ControlEditDesc() = delete;
ControlEditDesc(ControlEditDesc &&) = default;

View File

@ -2976,7 +2976,8 @@ constexpr PositiveDigitStringIgnoreSpaces count;
// R1313 control-edit-desc ->
// position-edit-desc | [r] / | : | sign-edit-desc | k P |
// blank-interp-edit-desc | round-edit-desc | decimal-edit-desc
// blank-interp-edit-desc | round-edit-desc | decimal-edit-desc |
// @ \ | $
// R1315 position-edit-desc -> T n | TL n | TR n | n X
// R1316 n -> digit-string
// R1317 sign-edit-desc -> SS | SP | S
@ -3023,7 +3024,12 @@ TYPE_PARSER(construct<format::ControlEditDesc>(
"D" >> ("C" >> construct<format::ControlEditDesc>(
pure(format::ControlEditDesc::Kind::DC)) ||
"P" >> construct<format::ControlEditDesc>(
pure(format::ControlEditDesc::Kind::DP))))
pure(format::ControlEditDesc::Kind::DP))) ||
extension<LanguageFeature::AdditionalFormats>(
"$" >> construct<format::ControlEditDesc>(
pure(format::ControlEditDesc::Kind::Dollar)) ||
"\\" >> construct<format::ControlEditDesc>(
pure(format::ControlEditDesc::Kind::Backslash))))
// R1401 main-program ->
// [program-stmt] [specification-part] [execution-part]