From: peter klausler Date: Fri, 30 Mar 2018 18:32:37 +0000 (-0700) Subject: [flang] Remove some needless checks for mandatory spaces before keywords and names... X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fdae1bfc4a13c45081c32735f2ccc1612aaad23e;p=platform%2Fupstream%2Fllvm.git [flang] Remove some needless checks for mandatory spaces before keywords and names that could not be present anyway, they were slowing things down. Original-commit: flang-compiler/f18@a07b78d2d76c994d0594fba6c38d3b98f3d03e9f Reviewed-on: https://github.com/flang-compiler/f18/pull/35 --- diff --git a/flang/lib/parser/grammar.h b/flang/lib/parser/grammar.h index fde11c2..e466d52 100644 --- a/flang/lib/parser/grammar.h +++ b/flang/lib/parser/grammar.h @@ -714,16 +714,14 @@ constexpr auto signedDigitString = "-"_ch >> // R707 signed-int-literal-constant -> [sign] int-literal-constant TYPE_PARSER(space >> sourced(construct{}( - signedDigitString, maybe(underscore >> kindParam))) / - spaceCheck) + signedDigitString, maybe(underscore >> kindParam)))) // R708 int-literal-constant -> digit-string [_ kind-param] TYPE_PARSER(construct{}( - space >> digitString, maybe(underscore >> kindParam)) / - spaceCheck) + space >> digitString, maybe(underscore >> kindParam))) // R709 kind-param -> digit-string | scalar-int-constant-name -TYPE_PARSER(construct{}(digitString / spaceCheck) || +TYPE_PARSER(construct{}(digitString) || construct{}(scalar(integer(constant(name))))) // R712 sign -> + | - @@ -755,8 +753,7 @@ TYPE_CONTEXT_PARSER("REAL literal constant"_en_US, "."_ch >> digitString >> maybe(exponentPart) >> ok || digitString >> exponentPart >> ok) >> construct{}), - maybe(underscore >> kindParam)) / - spaceCheck) + maybe(underscore >> kindParam))) // R718 complex-literal-constant -> ( real-part , imag-part ) TYPE_CONTEXT_PARSER("COMPLEX literal constant"_en_US,