diff options
author | Brad King <brad.king@kitware.com> | 2022-08-09 13:07:24 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-08-09 13:09:51 (GMT) |
commit | a7211d6a2fd3097f88af94633b584d8ff76a8bce (patch) | |
tree | 40f62046de5ef271b6835ba48b76b35220acf47a /Source/LexerParser | |
parent | 8ca7a53cdd0bf82f93447a581c95ca738df2d86c (diff) | |
download | CMake-a7211d6a2fd3097f88af94633b584d8ff76a8bce.zip CMake-a7211d6a2fd3097f88af94633b584d8ff76a8bce.tar.gz CMake-a7211d6a2fd3097f88af94633b584d8ff76a8bce.tar.bz2 |
Fortran: Teach lexer to handle CRLF newlines
We read sources in binary format, so we need to explicitly match CR
(`\r`) characters that occur as part of newlines in CRLF sources.
This is particularly important when line continuation (`&`) occurs
in the middle of module declaration or usage.
Diffstat (limited to 'Source/LexerParser')
-rw-r--r-- | Source/LexerParser/cmFortranLexer.cxx | 377 | ||||
-rw-r--r-- | Source/LexerParser/cmFortranLexer.in.l | 16 |
2 files changed, 201 insertions, 192 deletions
diff --git a/Source/LexerParser/cmFortranLexer.cxx b/Source/LexerParser/cmFortranLexer.cxx index c3d0000..5703de1 100644 --- a/Source/LexerParser/cmFortranLexer.cxx +++ b/Source/LexerParser/cmFortranLexer.cxx @@ -557,31 +557,32 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static const flex_int16_t yy_accept[210] = +static const flex_int16_t yy_accept[216] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 49, 51, 50, 53, 1, 49, 33, 2, 47, 48, 35, 37, 50, 39, 49, 46, 46, 46, 46, - 46, 46, 49, 46, 51, 49, 50, 49, 46, 9, - 8, 9, 4, 3, 49, 0, 10, 0, 0, 0, - 0, 0, 33, 33, 34, 36, 39, 49, 46, 46, - 46, 46, 46, 46, 0, 52, 46, 0, 0, 0, - 12, 0, 0, 0, 0, 0, 0, 49, 0, 11, - 46, 0, 0, 5, 0, 0, 0, 0, 29, 0, - 33, 33, 33, 33, 0, 0, 40, 46, 46, 46, - - 46, 45, 12, 12, 0, 0, 0, 23, 0, 0, - 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 46, 46, 46, 46, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 30, 31, 0, 0, 0, 0, 0, 46, 46, - 46, 46, 0, 24, 25, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 20, 32, 27, 0, 0, 0, - 46, 46, 43, 46, 0, 26, 21, 0, 0, 0, - 19, 0, 0, 18, 28, 0, 0, 41, 46, 46, - 17, 22, 0, 7, 38, 7, 15, 0, 46, 46, - - 14, 16, 42, 44, 0, 0, 0, 13, 0 + 46, 46, 49, 46, 51, 49, 50, 51, 49, 46, + 9, 8, 9, 9, 4, 3, 49, 0, 10, 0, + 0, 0, 0, 0, 33, 33, 34, 36, 39, 49, + 46, 46, 46, 46, 46, 46, 0, 52, 0, 46, + 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, + 0, 49, 0, 11, 46, 0, 0, 0, 5, 0, + 0, 0, 0, 0, 29, 0, 33, 33, 33, 33, + + 0, 0, 40, 46, 46, 46, 46, 45, 12, 12, + 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 46, 46, 46, 46, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 30, 31, 0, + 0, 0, 0, 0, 46, 46, 46, 46, 0, 24, + 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 20, 32, 27, 0, 0, 0, 46, 46, 43, 46, + 0, 26, 21, 0, 0, 0, 19, 0, 0, 18, + 28, 0, 0, 41, 46, 46, 17, 22, 0, 7, + + 38, 7, 15, 0, 46, 46, 14, 16, 42, 44, + 0, 0, 0, 13, 0 } ; static const YY_CHAR yy_ec[256] = @@ -618,189 +619,197 @@ static const YY_CHAR yy_ec[256] = static const YY_CHAR yy_meta[50] = { 0, - 1, 2, 2, 3, 4, 3, 3, 1, 1, 3, - 3, 3, 3, 1, 3, 5, 3, 3, 1, 3, + 1, 2, 2, 2, 3, 4, 4, 1, 1, 4, + 4, 4, 4, 1, 4, 5, 4, 4, 1, 4, 6, 1, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 1, 5, 7, 7, 7, 7, 7, 7, 7, 7, 7 } ; -static const flex_int16_t yy_base[219] = +static const flex_int16_t yy_base[225] = { 0, - 0, 48, 0, 49, 464, 56, 52, 57, 62, 68, - 466, 0, 468, 468, 462, 468, 74, 81, 468, 468, - 468, 468, 447, 468, 442, 440, 0, 19, 41, 427, - 47, 41, 90, 119, 97, 158, 455, 207, 247, 468, - 454, 101, 468, 468, 0, 455, 468, 105, 430, 423, - 62, 67, 119, 151, 468, 468, 468, 121, 0, 90, - 93, 110, 431, 112, 142, 468, 0, 160, 295, 0, - 162, 411, 123, 102, 408, 405, 446, 344, 447, 468, - 0, 444, 170, 174, 420, 421, 132, 404, 95, 404, - 180, 186, 192, 228, 297, 397, 0, 168, 144, 52, - - 411, 0, 204, 217, 397, 179, 390, 170, 389, 378, - 364, 390, 389, 230, 468, 363, 355, 337, 337, 334, - 335, 335, 330, 334, 187, 339, 267, 339, 327, 327, - 327, 324, 325, 325, 318, 319, 318, 354, 352, 323, - 327, 468, 468, 310, 307, 305, 297, 297, 275, 275, - 277, 279, 287, 468, 468, 286, 283, 273, 196, 307, - 200, 238, 234, 210, 468, 468, 468, 174, 171, 162, - 279, 182, 0, 269, 150, 468, 468, 137, 109, 323, - 468, 239, 0, 468, 468, 72, 71, 0, 283, 283, - 468, 468, 51, 468, 468, 468, 468, 37, 283, 288, - - 330, 468, 0, 0, 331, 0, 52, 468, 468, 384, - 391, 397, 400, 407, 414, 421, 428, 435 + 0, 48, 0, 49, 55, 58, 64, 66, 75, 83, + 491, 0, 492, 492, 487, 492, 86, 92, 492, 492, + 492, 492, 472, 492, 467, 465, 0, 56, 59, 452, + 66, 16, 105, 131, 109, 170, 480, 481, 219, 259, + 492, 478, 479, 116, 492, 492, 0, 478, 492, 111, + 453, 446, 34, 78, 155, 174, 492, 492, 492, 121, + 0, 29, 105, 101, 454, 101, 131, 492, 474, 0, + 180, 307, 0, 146, 433, 117, 94, 430, 427, 468, + 467, 356, 468, 492, 0, 465, 464, 187, 191, 465, + 439, 440, 149, 423, 126, 423, 200, 240, 311, 322, + + 206, 416, 0, 152, 180, 176, 430, 0, 216, 224, + 417, 186, 418, 127, 418, 411, 415, 451, 450, 247, + 492, 423, 416, 398, 393, 373, 364, 364, 359, 353, + 198, 358, 178, 358, 346, 346, 346, 343, 344, 344, + 338, 340, 339, 376, 374, 343, 346, 492, 492, 329, + 325, 324, 313, 315, 211, 211, 291, 293, 313, 492, + 492, 314, 304, 304, 261, 328, 212, 249, 243, 203, + 492, 492, 492, 173, 158, 150, 293, 172, 0, 273, + 144, 492, 492, 137, 125, 335, 492, 339, 0, 492, + 492, 112, 63, 0, 304, 300, 492, 492, 58, 492, + + 492, 492, 492, 30, 311, 312, 361, 492, 0, 0, + 366, 0, 44, 492, 492, 396, 403, 409, 412, 419, + 426, 433, 440, 447 } ; -static const flex_int16_t yy_def[219] = +static const flex_int16_t yy_def[225] = { 0, - 209, 1, 1, 1, 1, 1, 210, 210, 210, 210, - 209, 211, 209, 209, 212, 209, 211, 209, 209, 209, - 209, 209, 209, 209, 209, 211, 213, 213, 213, 213, - 213, 213, 211, 213, 209, 211, 209, 214, 209, 209, - 209, 209, 209, 209, 211, 212, 209, 209, 209, 209, - 209, 209, 209, 215, 209, 209, 209, 211, 213, 213, - 213, 213, 213, 213, 209, 209, 34, 209, 209, 69, - 211, 209, 209, 209, 209, 209, 209, 214, 214, 209, - 39, 209, 209, 209, 209, 209, 209, 209, 209, 209, - 215, 215, 215, 215, 209, 209, 213, 213, 213, 213, - - 213, 213, 209, 209, 209, 209, 209, 209, 209, 209, - 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - 209, 209, 209, 209, 213, 213, 213, 213, 209, 209, - 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - 209, 209, 209, 209, 209, 209, 209, 209, 213, 213, - 213, 213, 209, 209, 209, 209, 209, 209, 209, 209, - 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - 213, 213, 213, 213, 209, 209, 209, 209, 209, 209, - 209, 216, 217, 209, 209, 209, 209, 213, 213, 213, - 209, 209, 209, 209, 209, 209, 209, 209, 213, 213, - - 209, 209, 213, 213, 209, 218, 218, 209, 0, 209, - 209, 209, 209, 209, 209, 209, 209, 209 + 215, 1, 1, 1, 1, 1, 216, 216, 216, 216, + 215, 217, 215, 215, 218, 215, 217, 215, 215, 215, + 215, 215, 215, 215, 215, 217, 219, 219, 219, 219, + 219, 219, 217, 219, 215, 217, 215, 215, 220, 215, + 215, 215, 215, 215, 215, 215, 217, 218, 215, 215, + 215, 215, 215, 215, 215, 221, 215, 215, 215, 217, + 219, 219, 219, 219, 219, 219, 215, 215, 215, 34, + 215, 215, 72, 217, 215, 215, 215, 215, 215, 215, + 215, 220, 220, 215, 40, 215, 215, 215, 215, 215, + 215, 215, 215, 215, 215, 215, 221, 221, 221, 221, + + 215, 215, 219, 219, 219, 219, 219, 219, 215, 215, + 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, + 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, + 219, 219, 219, 219, 215, 215, 215, 215, 215, 215, + 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, + 215, 215, 215, 215, 219, 219, 219, 219, 215, 215, + 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, + 215, 215, 215, 215, 215, 215, 219, 219, 219, 219, + 215, 215, 215, 215, 215, 215, 215, 222, 223, 215, + 215, 215, 215, 219, 219, 219, 215, 215, 215, 215, + + 215, 215, 215, 215, 219, 219, 215, 215, 219, 219, + 215, 224, 224, 215, 0, 215, 215, 215, 215, 215, + 215, 215, 215, 215 } ; -static const flex_int16_t yy_nxt[518] = +static const flex_int16_t yy_nxt[542] = { 0, 12, 13, 14, 13, 13, 15, 16, 12, 17, 18, 19, 20, 21, 12, 22, 12, 23, 24, 12, 25, 12, 26, 27, 27, 27, 27, 28, 27, 27, 29, 27, 30, 27, 27, 27, 31, 27, 32, 33, 34, 27, 27, 28, 27, 29, 27, 27, 31, 32, 35, - 35, 60, 35, 35, 41, 36, 36, 35, 37, 41, - 35, 42, 43, 36, 41, 60, 42, 43, 44, 38, - 41, 42, 208, 61, 44, 48, 64, 42, 48, 202, - 39, 39, 53, 53, 63, 53, 54, 61, 64, 127, - 55, 65, 66, 201, 65, 63, 39, 39, 68, 49, - - 127, 68, 83, 84, 69, 83, 48, 87, 88, 48, - 89, 50, 198, 90, 197, 97, 51, 98, 52, 45, - 53, 53, 95, 53, 54, 95, 45, 45, 55, 99, - 49, 97, 45, 98, 67, 100, 121, 45, 102, 45, - 45, 122, 50, 65, 66, 108, 65, 51, 109, 52, - 193, 100, 92, 53, 102, 92, 93, 45, 67, 70, - 94, 68, 70, 104, 68, 96, 104, 69, 106, 107, - 126, 83, 84, 71, 83, 114, 118, 71, 114, 119, - 192, 92, 53, 115, 92, 93, 126, 92, 53, 94, - 92, 93, 191, 92, 53, 94, 92, 93, 125, 72, - - 73, 94, 74, 75, 189, 104, 76, 78, 104, 80, - 187, 133, 186, 125, 78, 78, 134, 185, 104, 103, - 78, 104, 78, 130, 149, 78, 131, 78, 78, 92, - 53, 114, 92, 93, 114, 149, 184, 94, 183, 115, - 195, 195, 182, 181, 179, 78, 78, 79, 79, 80, - 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, - 79, 79, 81, 79, 79, 79, 79, 79, 79, 81, - 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, - 81, 81, 81, 81, 81, 79, 81, 81, 81, 81, - 81, 81, 81, 81, 81, 81, 70, 151, 95, 70, - - 171, 95, 172, 173, 174, 188, 190, 199, 180, 203, - 103, 180, 151, 200, 204, 178, 171, 190, 172, 173, - 174, 188, 103, 199, 180, 203, 177, 180, 200, 176, - 204, 205, 205, 175, 205, 205, 72, 73, 103, 74, - 75, 96, 170, 76, 78, 169, 80, 168, 206, 206, - 167, 78, 78, 166, 165, 164, 163, 78, 162, 78, - 161, 160, 78, 159, 78, 78, 158, 157, 156, 155, - 154, 153, 152, 150, 148, 147, 146, 145, 144, 143, - 142, 141, 78, 78, 40, 40, 40, 40, 40, 40, - 40, 45, 140, 139, 138, 45, 45, 46, 46, 46, - - 46, 46, 46, 46, 59, 137, 59, 79, 79, 79, - 79, 79, 79, 79, 91, 91, 91, 91, 91, 91, - 91, 194, 194, 194, 136, 194, 194, 194, 196, 135, - 196, 132, 196, 196, 196, 207, 207, 207, 207, 207, - 129, 207, 128, 124, 123, 120, 117, 116, 113, 80, - 112, 111, 110, 105, 101, 86, 85, 47, 82, 77, - 62, 58, 57, 56, 47, 209, 37, 11, 209, 209, - 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - - 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - 209, 209, 209, 209, 209, 209, 209 + 35, 66, 35, 35, 103, 36, 36, 37, 38, 35, + 37, 38, 35, 66, 214, 36, 42, 43, 42, 43, + 103, 39, 208, 44, 45, 44, 45, 42, 43, 93, + 94, 46, 40, 40, 44, 42, 43, 50, 62, 46, + 50, 63, 44, 55, 55, 55, 55, 56, 40, 40, + + 207, 57, 62, 65, 204, 63, 67, 68, 69, 67, + 71, 51, 50, 71, 65, 50, 72, 88, 89, 90, + 88, 95, 101, 52, 96, 101, 106, 108, 53, 104, + 54, 47, 67, 68, 69, 67, 51, 114, 47, 47, + 115, 105, 106, 108, 47, 104, 70, 110, 52, 47, + 110, 47, 47, 53, 203, 54, 55, 55, 55, 55, + 56, 74, 112, 113, 57, 102, 199, 127, 139, 47, + 70, 73, 128, 140, 73, 98, 55, 98, 98, 99, + 198, 71, 131, 100, 71, 74, 197, 72, 88, 89, + 90, 88, 120, 124, 195, 120, 125, 131, 193, 192, + + 121, 98, 55, 98, 98, 99, 132, 101, 157, 100, + 101, 75, 76, 133, 77, 78, 191, 110, 79, 82, + 110, 84, 132, 157, 133, 110, 82, 82, 110, 190, + 136, 109, 82, 137, 82, 155, 177, 82, 178, 82, + 82, 98, 55, 98, 98, 99, 155, 189, 120, 100, + 102, 120, 177, 188, 178, 187, 121, 82, 82, 83, + 83, 84, 83, 83, 83, 83, 83, 83, 83, 83, + 83, 83, 83, 83, 85, 83, 83, 83, 83, 83, + 83, 85, 85, 85, 85, 85, 85, 85, 85, 85, + 85, 85, 85, 85, 85, 85, 85, 83, 85, 85, + + 85, 85, 85, 85, 85, 85, 85, 85, 73, 185, + 196, 73, 98, 55, 98, 98, 99, 179, 180, 194, + 100, 196, 109, 98, 55, 98, 98, 99, 205, 186, + 206, 100, 186, 179, 180, 194, 186, 209, 210, 186, + 201, 201, 201, 109, 205, 206, 184, 183, 75, 76, + 109, 77, 78, 209, 210, 79, 82, 182, 84, 181, + 176, 175, 211, 82, 82, 211, 174, 211, 173, 82, + 211, 82, 172, 171, 82, 170, 82, 82, 169, 212, + 168, 167, 166, 165, 212, 164, 163, 162, 161, 160, + 159, 158, 156, 154, 82, 82, 41, 41, 41, 41, + + 41, 41, 41, 47, 153, 152, 151, 47, 47, 48, + 48, 48, 48, 48, 48, 48, 61, 150, 61, 83, + 83, 83, 83, 83, 83, 83, 97, 97, 97, 97, + 97, 97, 97, 200, 200, 149, 200, 200, 200, 200, + 202, 148, 147, 202, 202, 202, 202, 213, 213, 213, + 213, 213, 146, 213, 145, 144, 143, 142, 141, 138, + 135, 134, 130, 129, 126, 123, 122, 89, 86, 119, + 84, 80, 118, 117, 116, 111, 68, 107, 92, 91, + 49, 87, 86, 81, 80, 64, 60, 59, 58, 49, + 215, 11, 215, 215, 215, 215, 215, 215, 215, 215, + + 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, + 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, + 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, + 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, + 215 } ; -static const flex_int16_t yy_chk[518] = +static const flex_int16_t yy_chk[542] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, - 4, 28, 2, 4, 7, 2, 4, 6, 6, 8, - 6, 7, 7, 6, 9, 28, 8, 8, 9, 6, - 10, 9, 207, 29, 10, 17, 32, 10, 17, 198, - 6, 6, 18, 18, 31, 18, 18, 29, 32, 100, - 18, 33, 33, 193, 33, 31, 6, 6, 35, 17, - - 100, 35, 42, 42, 35, 42, 48, 51, 51, 48, - 52, 17, 187, 52, 186, 60, 17, 61, 17, 34, - 53, 53, 58, 53, 53, 58, 34, 34, 53, 61, - 48, 60, 34, 61, 34, 62, 89, 34, 64, 34, - 34, 89, 48, 65, 65, 74, 65, 48, 74, 48, - 179, 62, 54, 54, 64, 54, 54, 34, 34, 36, - 54, 68, 36, 71, 68, 58, 71, 68, 73, 73, - 99, 83, 83, 36, 83, 84, 87, 71, 84, 87, - 178, 91, 91, 84, 91, 91, 99, 92, 92, 91, - 92, 92, 175, 93, 93, 92, 93, 93, 98, 36, - - 36, 93, 36, 36, 172, 103, 36, 38, 103, 38, - 170, 108, 169, 98, 38, 38, 108, 168, 104, 103, - 38, 104, 38, 106, 125, 38, 106, 38, 38, 94, - 94, 114, 94, 94, 114, 125, 164, 94, 163, 114, - 182, 182, 162, 161, 159, 38, 38, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 69, 127, 95, 69, - - 149, 95, 150, 151, 152, 171, 174, 189, 160, 199, - 69, 160, 127, 190, 200, 158, 149, 174, 150, 151, - 152, 171, 160, 189, 180, 199, 157, 180, 190, 156, - 200, 201, 205, 153, 201, 205, 69, 69, 180, 69, - 69, 95, 148, 69, 78, 147, 78, 146, 201, 205, - 145, 78, 78, 144, 141, 140, 139, 78, 138, 78, - 137, 136, 78, 135, 78, 78, 134, 133, 132, 131, - 130, 129, 128, 126, 124, 123, 122, 121, 120, 119, - 118, 117, 78, 78, 210, 210, 210, 210, 210, 210, - 210, 211, 116, 113, 112, 211, 211, 212, 212, 212, - - 212, 212, 212, 212, 213, 111, 213, 214, 214, 214, - 214, 214, 214, 214, 215, 215, 215, 215, 215, 215, - 215, 216, 216, 216, 110, 216, 216, 216, 217, 109, - 217, 107, 217, 217, 217, 218, 218, 218, 218, 218, - 105, 218, 101, 96, 90, 88, 86, 85, 82, 79, - 77, 76, 75, 72, 63, 50, 49, 46, 41, 37, - 30, 26, 25, 23, 15, 11, 5, 209, 209, 209, - 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - - 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - 209, 209, 209, 209, 209, 209, 209 + 4, 32, 2, 4, 62, 2, 4, 5, 5, 6, + 6, 6, 6, 32, 213, 6, 7, 7, 8, 8, + 62, 6, 204, 7, 7, 8, 8, 9, 9, 53, + 53, 9, 6, 6, 9, 10, 10, 17, 28, 10, + 17, 29, 10, 18, 18, 18, 18, 18, 6, 6, + + 199, 18, 28, 31, 193, 29, 33, 33, 33, 33, + 35, 17, 50, 35, 31, 50, 35, 44, 44, 44, + 44, 54, 60, 17, 54, 60, 64, 66, 17, 63, + 17, 34, 67, 67, 67, 67, 50, 77, 34, 34, + 77, 63, 64, 66, 34, 63, 34, 74, 50, 34, + 74, 34, 34, 50, 192, 50, 55, 55, 55, 55, + 55, 74, 76, 76, 55, 60, 185, 95, 114, 34, + 34, 36, 95, 114, 36, 56, 56, 56, 56, 56, + 184, 71, 104, 56, 71, 36, 181, 71, 88, 88, + 88, 88, 89, 93, 178, 89, 93, 104, 176, 175, + + 89, 97, 97, 97, 97, 97, 105, 101, 133, 97, + 101, 36, 36, 106, 36, 36, 174, 109, 36, 39, + 109, 39, 105, 133, 106, 110, 39, 39, 110, 170, + 112, 109, 39, 112, 39, 131, 155, 39, 156, 39, + 39, 98, 98, 98, 98, 98, 131, 169, 120, 98, + 101, 120, 155, 168, 156, 167, 120, 39, 39, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + + 40, 40, 40, 40, 40, 40, 40, 40, 72, 165, + 180, 72, 99, 99, 99, 99, 99, 157, 158, 177, + 99, 180, 72, 100, 100, 100, 100, 100, 195, 166, + 196, 100, 166, 157, 158, 177, 186, 205, 206, 186, + 188, 188, 188, 166, 195, 196, 164, 163, 72, 72, + 186, 72, 72, 205, 206, 72, 82, 162, 82, 159, + 154, 153, 207, 82, 82, 207, 152, 211, 151, 82, + 211, 82, 150, 147, 82, 146, 82, 82, 145, 207, + 144, 143, 142, 141, 211, 140, 139, 138, 137, 136, + 135, 134, 132, 130, 82, 82, 216, 216, 216, 216, + + 216, 216, 216, 217, 129, 128, 127, 217, 217, 218, + 218, 218, 218, 218, 218, 218, 219, 126, 219, 220, + 220, 220, 220, 220, 220, 220, 221, 221, 221, 221, + 221, 221, 221, 222, 222, 125, 222, 222, 222, 222, + 223, 124, 123, 223, 223, 223, 223, 224, 224, 224, + 224, 224, 122, 224, 119, 118, 117, 116, 115, 113, + 111, 107, 102, 96, 94, 92, 91, 90, 87, 86, + 83, 81, 80, 79, 78, 75, 69, 65, 52, 51, + 48, 43, 42, 38, 37, 30, 26, 25, 23, 15, + 11, 215, 215, 215, 215, 215, 215, 215, 215, 215, + + 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, + 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, + 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, + 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, + 215 } ; /* The intent behind this definition is that it'll catch @@ -1139,13 +1148,13 @@ yy_match: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 210 ) + if ( yy_current_state >= 216 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 468 ); + while ( yy_base[yy_current_state] != 492 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -1733,7 +1742,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 210 ) + if ( yy_current_state >= 216 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; @@ -1762,11 +1771,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 210 ) + if ( yy_current_state >= 216 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - yy_is_jam = (yy_current_state == 209); + yy_is_jam = (yy_current_state == 215); (void)yyg; return yy_is_jam ? 0 : yy_current_state; diff --git a/Source/LexerParser/cmFortranLexer.in.l b/Source/LexerParser/cmFortranLexer.in.l index 05769a1..fac3181 100644 --- a/Source/LexerParser/cmFortranLexer.in.l +++ b/Source/LexerParser/cmFortranLexer.in.l @@ -75,10 +75,10 @@ Modify cmFortranLexer.cxx: return STRING; } -<str_dq,str_sq>&[ \t]*\n | -<str_dq,str_sq>&[ \t]*\n[ \t]*& /* Ignore (continued strings, free fmt) */ +<str_dq,str_sq>&[ \t]*\r?\n | +<str_dq,str_sq>&[ \t]*\r?\n[ \t]*& /* Ignore (continued strings, free fmt) */ -<fixed_fmt,str_dq,str_sq>\n[ ]{5}[^ \t\n] { +<fixed_fmt,str_dq,str_sq>\r?\n[ ]{5}[^ \t\r\n] { if (cmFortranParser_GetOldStartcond(yyextra) == fixed_fmt) ; /* Ignore (cont. strings, fixed fmt) */ else @@ -132,15 +132,15 @@ $[ \t]*else { return F90PPR_ELSE; } $[ \t]*endif { return F90PPR_ENDIF; } /* Line continuations, possible involving comments. */ -&([ \t\n]*|!.*)* -&([ \t\n]*|!.*)*& +&([ \t\r\n]*|!.*)* +&([ \t\r\n]*|!.*)*& , { return COMMA; } :: { return DCOLON; } : { return COLON; } -<fixed_fmt>\n[ ]{5}[^ ] { return GARBAGE; } +<fixed_fmt>\r?\n[ ]{5}[^ ] { return GARBAGE; } =|=> { return ASSIGNMENT_OP; } @@ -159,13 +159,13 @@ $[ \t]*endif { return F90PPR_ENDIF; } \( { return LPAREN; } \) { return RPAREN; } -[^ \t\n\r:;,!'"a-zA-Z=&()]+ { return GARBAGE; } +[^ \t\r\n:;,!'"a-zA-Z=&()]+ { return GARBAGE; } ;|\n { return EOSTMT; } [ \t\r,] /* Ignore */ -\\[ \t]*\n /* Ignore line-endings preceded by \ */ +\\[ \t]*\r?\n /* Ignore line-endings preceded by \ */ . { return *yytext; } |