| 1 |
------------------------------------------------------------------------------ |
| 2 |
-- -- |
| 3 |
-- GNAT COMPILER COMPONENTS -- |
| 4 |
-- -- |
| 5 |
-- S T Y L E S W -- |
| 6 |
-- -- |
| 7 |
-- B o d y -- |
| 8 |
-- -- |
| 9 |
-- Copyright (C) 1992-2025, Free Software Foundation, Inc. -- |
| 10 |
-- -- |
| 11 |
-- GNAT is free software; you can redistribute it and/or modify it under -- |
| 12 |
-- terms of the GNU General Public License as published by the Free Soft- -- |
| 13 |
-- ware Foundation; either version 3, or (at your option) any later ver- -- |
| 14 |
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- |
| 15 |
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- |
| 16 |
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- |
| 17 |
-- for more details. You should have received a copy of the GNU General -- |
| 18 |
-- Public License distributed with GNAT; see file COPYING3. If not, go to -- |
| 19 |
-- http://www.gnu.org/licenses for a complete copy of the license. -- |
| 20 |
-- -- |
| 21 |
-- GNAT was originally developed by the GNAT team at New York University. -- |
| 22 |
-- Extensive contributions were provided by Ada Core Technologies Inc. -- |
| 23 |
-- -- |
| 24 |
------------------------------------------------------------------------------ |
| 25 |
|
| 26 |
with Hostparm; use Hostparm; |
| 27 |
with Opt; use Opt; |
| 28 |
with Output; use Output; |
| 29 |
|
| 30 |
package body Stylesw is |
| 31 |
|
| 32 |
-- The following constant defines the default style options for -gnaty |
| 33 |
|
| 34 |
Default_Style : constant String := |
| 35 |
"3" & -- indentation level is 3 |
| 36 |
"a" & -- check attribute casing |
| 37 |
"A" & -- check array attribute indexes |
| 38 |
"b" & -- check no blanks at end of lines |
| 39 |
"c" & -- check comment formats |
| 40 |
"e" & -- check end/exit labels present |
| 41 |
"f" & -- check no form/feeds vertical tabs in source |
| 42 |
"h" & -- check no horizontal tabs in source |
| 43 |
"i" & -- check if-then layout |
| 44 |
"k" & -- check casing rules for keywords |
| 45 |
"l" & -- check reference manual layout |
| 46 |
"m" & -- check line length <= 79 characters |
| 47 |
"n" & -- check casing of package Standard idents |
| 48 |
"p" & -- check pragma casing |
| 49 |
"r" & -- check casing for identifier references |
| 50 |
"s" & -- check separate subprogram specs present |
| 51 |
"t"; -- check token separation rules |
| 52 |
|
| 53 |
-- The following constant defines the GNAT style options, showing them |
| 54 |
-- as additions to the standard default style check options. |
| 55 |
|
| 56 |
GNAT_Style : constant String := Default_Style & |
| 57 |
"d" & -- check no DOS line terminators |
| 58 |
"I" & -- check mode IN |
| 59 |
"S" & -- check separate lines after THEN or ELSE |
| 60 |
"u" & -- check no unnecessary blank lines |
| 61 |
"x" & -- check extra parentheses around conditionals |
| 62 |
"z"; -- check parens not required by precedence rules. |
| 63 |
|
| 64 |
------------------------------- |
| 65 |
-- Reset_Style_Check_Options -- |
| 66 |
------------------------------- |
| 67 |
|
| 68 |
procedure Reset_Style_Check_Options is |
| 69 |
begin |
| 70 |
Style_Check_Indentation := 0; |
| 71 |
Style_Check_Array_Attribute_Index := False; |
| 72 |
Style_Check_Attribute_Casing := False; |
| 73 |
Style_Check_Blanks_At_End := False; |
| 74 |
Style_Check_Blank_Lines := False; |
| 75 |
Style_Check_Boolean_And_Or := False; |
| 76 |
Style_Check_Comments := False; |
| 77 |
Style_Check_DOS_Line_Terminator := False; |
| 78 |
Style_Check_Mixed_Case_Decls := False; |
| 79 |
Style_Check_End_Labels := False; |
| 80 |
Style_Check_Form_Feeds := False; |
| 81 |
Style_Check_Horizontal_Tabs := False; |
| 82 |
Style_Check_If_Then_Layout := False; |
| 83 |
Style_Check_Keyword_Casing := False; |
| 84 |
Style_Check_Layout := False; |
| 85 |
Style_Check_Max_Line_Length := False; |
| 86 |
Style_Check_Max_Nesting_Level := False; |
| 87 |
Style_Check_Missing_Overriding := False; |
| 88 |
Style_Check_Mode_In := False; |
| 89 |
Style_Check_Order_Subprograms := False; |
| 90 |
Style_Check_Pragma_Casing := False; |
| 91 |
Style_Check_References := False; |
| 92 |
Style_Check_Separate_Stmt_Lines := False; |
| 93 |
Style_Check_Specs := False; |
| 94 |
Style_Check_Standard := False; |
| 95 |
Style_Check_Tokens := False; |
| 96 |
Style_Check_Xtra_Parens := False; |
| 97 |
Style_Check_Xtra_Parens_Precedence := False; |
| 98 |
end Reset_Style_Check_Options; |
| 99 |
|
| 100 |
--------------------- |
| 101 |
-- RM_Column_Check -- |
| 102 |
--------------------- |
| 103 |
|
| 104 |
function RM_Column_Check return Boolean is |
| 105 |
begin |
| 106 |
return Style_Check and Style_Check_Layout; |
| 107 |
end RM_Column_Check; |
| 108 |
|
| 109 |
------------------------------ |
| 110 |
-- Save_Style_Check_Options -- |
| 111 |
------------------------------ |
| 112 |
|
| 113 |
procedure Save_Style_Check_Options (Options : out Style_Check_Options) is |
| 114 |
P : Natural := 0; |
| 115 |
|
| 116 |
procedure Add (C : Character; S : Boolean); |
| 117 |
-- Add given character C to string if switch S is true |
| 118 |
|
| 119 |
procedure Add_Nat (N : Nat); |
| 120 |
-- Add given natural number to string |
| 121 |
|
| 122 |
--------- |
| 123 |
-- Add -- |
| 124 |
--------- |
| 125 |
|
| 126 |
procedure Add (C : Character; S : Boolean) is |
| 127 |
begin |
| 128 |
if S then |
| 129 |
P := P + 1; |
| 130 |
Options (P) := C; |
| 131 |
end if; |
| 132 |
end Add; |
| 133 |
|
| 134 |
------------- |
| 135 |
-- Add_Nat -- |
| 136 |
------------- |
| 137 |
|
| 138 |
procedure Add_Nat (N : Nat) is |
| 139 |
begin |
| 140 |
if N > 9 then |
| 141 |
Add_Nat (N / 10); |
| 142 |
end if; |
| 143 |
|
| 144 |
P := P + 1; |
| 145 |
Options (P) := Character'Val (Character'Pos ('0') + N mod 10); |
| 146 |
end Add_Nat; |
| 147 |
|
| 148 |
-- Start of processing for Save_Style_Check_Options |
| 149 |
|
| 150 |
begin |
| 151 |
Add (Character'Val (Style_Check_Indentation + Character'Pos ('0')), |
| 152 |
Style_Check_Indentation /= 0); |
| 153 |
|
| 154 |
Add ('a', Style_Check_Attribute_Casing); |
| 155 |
Add ('A', Style_Check_Array_Attribute_Index); |
| 156 |
Add ('b', Style_Check_Blanks_At_End); |
| 157 |
Add ('B', Style_Check_Boolean_And_Or); |
| 158 |
|
| 159 |
if Style_Check_Comments then |
| 160 |
if Style_Check_Comments_Spacing = 2 then |
| 161 |
Add ('c', Style_Check_Comments); |
| 162 |
else |
| 163 |
pragma Assert (Style_Check_Comments_Spacing = 1); |
| 164 |
Add ('C', Style_Check_Comments); |
| 165 |
end if; |
| 166 |
end if; |
| 167 |
|
| 168 |
Add ('d', Style_Check_DOS_Line_Terminator); |
| 169 |
Add ('D', Style_Check_Mixed_Case_Decls); |
| 170 |
Add ('e', Style_Check_End_Labels); |
| 171 |
Add ('f', Style_Check_Form_Feeds); |
| 172 |
Add ('h', Style_Check_Horizontal_Tabs); |
| 173 |
Add ('i', Style_Check_If_Then_Layout); |
| 174 |
Add ('I', Style_Check_Mode_In); |
| 175 |
Add ('k', Style_Check_Keyword_Casing); |
| 176 |
Add ('l', Style_Check_Layout); |
| 177 |
Add ('n', Style_Check_Standard); |
| 178 |
Add ('o', Style_Check_Order_Subprograms); |
| 179 |
Add ('O', Style_Check_Missing_Overriding); |
| 180 |
Add ('p', Style_Check_Pragma_Casing); |
| 181 |
Add ('r', Style_Check_References); |
| 182 |
Add ('s', Style_Check_Specs); |
| 183 |
Add ('S', Style_Check_Separate_Stmt_Lines); |
| 184 |
Add ('t', Style_Check_Tokens); |
| 185 |
Add ('u', Style_Check_Blank_Lines); |
| 186 |
Add ('x', Style_Check_Xtra_Parens); |
| 187 |
Add ('z', Style_Check_Xtra_Parens_Precedence); |
| 188 |
|
| 189 |
if Style_Check_Max_Line_Length then |
| 190 |
P := P + 1; |
| 191 |
Options (P) := 'M'; |
| 192 |
Add_Nat (Style_Max_Line_Length); |
| 193 |
end if; |
| 194 |
|
| 195 |
if Style_Check_Max_Nesting_Level then |
| 196 |
P := P + 1; |
| 197 |
Options (P) := 'L'; |
| 198 |
Add_Nat (Style_Max_Nesting_Level); |
| 199 |
end if; |
| 200 |
|
| 201 |
pragma Assert (P <= Options'Last); |
| 202 |
|
| 203 |
while P < Options'Last loop |
| 204 |
P := P + 1; |
| 205 |
Options (P) := ' '; |
| 206 |
end loop; |
| 207 |
end Save_Style_Check_Options; |
| 208 |
|
| 209 |
------------------------------------- |
| 210 |
-- Set_Default_Style_Check_Options -- |
| 211 |
------------------------------------- |
| 212 |
|
| 213 |
procedure Set_Default_Style_Check_Options is |
| 214 |
begin |
| 215 |
Reset_Style_Check_Options; |
| 216 |
Set_Style_Check_Options (Default_Style); |
| 217 |
end Set_Default_Style_Check_Options; |
| 218 |
|
| 219 |
---------------------------------- |
| 220 |
-- Set_GNAT_Style_Check_Options -- |
| 221 |
---------------------------------- |
| 222 |
|
| 223 |
procedure Set_GNAT_Style_Check_Options is |
| 224 |
begin |
| 225 |
Reset_Style_Check_Options; |
| 226 |
Set_Style_Check_Options (GNAT_Style); |
| 227 |
end Set_GNAT_Style_Check_Options; |
| 228 |
|
| 229 |
----------------------------- |
| 230 |
-- Set_Style_Check_Options -- |
| 231 |
----------------------------- |
| 232 |
|
| 233 |
-- Version used when no error checking is required |
| 234 |
|
| 235 |
procedure Set_Style_Check_Options (Options : String) is |
| 236 |
OK : Boolean; |
| 237 |
EC : Natural; |
| 238 |
pragma Warnings (Off, EC); |
| 239 |
begin |
| 240 |
Set_Style_Check_Options (Options, OK, EC); |
| 241 |
pragma Assert (OK); |
| 242 |
end Set_Style_Check_Options; |
| 243 |
|
| 244 |
-- Normal version with error checking |
| 245 |
|
| 246 |
procedure Set_Style_Check_Options |
| 247 |
(Options : String; |
| 248 |
OK : out Boolean; |
| 249 |
Err_Col : out Natural) |
| 250 |
is |
| 251 |
C : Character; |
| 252 |
|
| 253 |
On : Boolean := True; |
| 254 |
-- Set to False if minus encountered |
| 255 |
-- Set to True if plus encountered |
| 256 |
|
| 257 |
Last_Option : Character := ' '; |
| 258 |
-- Set to last character encountered |
| 259 |
|
| 260 |
procedure Add_Img (N : Natural); |
| 261 |
-- Concatenates image of N at end of Style_Msg_Buf |
| 262 |
|
| 263 |
procedure Bad_Style_Switch (Msg : String); |
| 264 |
-- Called if bad style switch found. Msg is set in Style_Msg_Buf and |
| 265 |
-- Style_Msg_Len. OK is set False. |
| 266 |
|
| 267 |
------------- |
| 268 |
-- Add_Img -- |
| 269 |
------------- |
| 270 |
|
| 271 |
procedure Add_Img (N : Natural) is |
| 272 |
begin |
| 273 |
if N >= 10 then |
| 274 |
Add_Img (N / 10); |
| 275 |
end if; |
| 276 |
|
| 277 |
Style_Msg_Len := Style_Msg_Len + 1; |
| 278 |
Style_Msg_Buf (Style_Msg_Len) := |
| 279 |
Character'Val (N mod 10 + Character'Pos ('0')); |
| 280 |
end Add_Img; |
| 281 |
|
| 282 |
---------------------- |
| 283 |
-- Bad_Style_Switch -- |
| 284 |
---------------------- |
| 285 |
|
| 286 |
procedure Bad_Style_Switch (Msg : String) is |
| 287 |
begin |
| 288 |
OK := False; |
| 289 |
Style_Msg_Len := Msg'Length; |
| 290 |
Style_Msg_Buf (1 .. Style_Msg_Len) := Msg; |
| 291 |
end Bad_Style_Switch; |
| 292 |
|
| 293 |
-- Start of processing for Set_Style_Check_Options |
| 294 |
|
| 295 |
begin |
| 296 |
Err_Col := Options'First; |
| 297 |
while Err_Col <= Options'Last loop |
| 298 |
C := Options (Err_Col); |
| 299 |
Last_Option := C; |
| 300 |
Err_Col := Err_Col + 1; |
| 301 |
|
| 302 |
-- Turning switches on |
| 303 |
|
| 304 |
if On then |
| 305 |
case C is |
| 306 |
when '+' => |
| 307 |
null; |
| 308 |
|
| 309 |
when '-' => |
| 310 |
On := False; |
| 311 |
|
| 312 |
when '0' .. '9' => |
| 313 |
Style_Check_Indentation := |
| 314 |
Character'Pos (C) - Character'Pos ('0'); |
| 315 |
|
| 316 |
when 'a' => |
| 317 |
Style_Check_Attribute_Casing := True; |
| 318 |
|
| 319 |
when 'A' => |
| 320 |
Style_Check_Array_Attribute_Index := True; |
| 321 |
|
| 322 |
when 'b' => |
| 323 |
Style_Check_Blanks_At_End := True; |
| 324 |
|
| 325 |
when 'B' => |
| 326 |
Style_Check_Boolean_And_Or := True; |
| 327 |
|
| 328 |
when 'c' => |
| 329 |
Style_Check_Comments := True; |
| 330 |
Style_Check_Comments_Spacing := 2; |
| 331 |
|
| 332 |
when 'C' => |
| 333 |
Style_Check_Comments := True; |
| 334 |
Style_Check_Comments_Spacing := 1; |
| 335 |
|
| 336 |
when 'd' => |
| 337 |
Style_Check_DOS_Line_Terminator := True; |
| 338 |
|
| 339 |
when 'D' => |
| 340 |
Style_Check_Mixed_Case_Decls := True; |
| 341 |
|
| 342 |
when 'e' => |
| 343 |
Style_Check_End_Labels := True; |
| 344 |
|
| 345 |
when 'f' => |
| 346 |
Style_Check_Form_Feeds := True; |
| 347 |
|
| 348 |
when 'g' => |
| 349 |
Set_GNAT_Style_Check_Options; |
| 350 |
|
| 351 |
when 'h' => |
| 352 |
Style_Check_Horizontal_Tabs := True; |
| 353 |
|
| 354 |
when 'i' => |
| 355 |
Style_Check_If_Then_Layout := True; |
| 356 |
|
| 357 |
when 'I' => |
| 358 |
Style_Check_Mode_In := True; |
| 359 |
|
| 360 |
when 'k' => |
| 361 |
Style_Check_Keyword_Casing := True; |
| 362 |
|
| 363 |
when 'l' => |
| 364 |
Style_Check_Layout := True; |
| 365 |
|
| 366 |
when 'L' => |
| 367 |
Style_Max_Nesting_Level := 0; |
| 368 |
|
| 369 |
if Err_Col > Options'Last |
| 370 |
or else Options (Err_Col) not in '0' .. '9' |
| 371 |
then |
| 372 |
Bad_Style_Switch ("invalid nesting level"); |
| 373 |
return; |
| 374 |
end if; |
| 375 |
|
| 376 |
loop |
| 377 |
Style_Max_Nesting_Level := |
| 378 |
Style_Max_Nesting_Level * 10 + |
| 379 |
Character'Pos (Options (Err_Col)) - Character'Pos ('0'); |
| 380 |
|
| 381 |
if Style_Max_Nesting_Level > 999 then |
| 382 |
Bad_Style_Switch |
| 383 |
("max nesting level (999) exceeded in style check"); |
| 384 |
return; |
| 385 |
end if; |
| 386 |
|
| 387 |
Err_Col := Err_Col + 1; |
| 388 |
exit when Err_Col > Options'Last |
| 389 |
or else Options (Err_Col) not in '0' .. '9'; |
| 390 |
end loop; |
| 391 |
|
| 392 |
Style_Check_Max_Nesting_Level := Style_Max_Nesting_Level /= 0; |
| 393 |
|
| 394 |
when 'm' => |
| 395 |
Style_Check_Max_Line_Length := True; |
| 396 |
Style_Max_Line_Length := 79; |
| 397 |
|
| 398 |
when 'M' => |
| 399 |
Style_Max_Line_Length := 0; |
| 400 |
|
| 401 |
if Err_Col > Options'Last |
| 402 |
or else Options (Err_Col) not in '0' .. '9' |
| 403 |
then |
| 404 |
Bad_Style_Switch |
| 405 |
("invalid line length in style check"); |
| 406 |
return; |
| 407 |
end if; |
| 408 |
|
| 409 |
loop |
| 410 |
Style_Max_Line_Length := |
| 411 |
Style_Max_Line_Length * 10 + |
| 412 |
Character'Pos (Options (Err_Col)) - Character'Pos ('0'); |
| 413 |
|
| 414 |
if Style_Max_Line_Length > Int (Max_Line_Length) then |
| 415 |
OK := False; |
| 416 |
Style_Msg_Buf (1 .. 27) := "max line length allowed is "; |
| 417 |
Style_Msg_Len := 27; |
| 418 |
Add_Img (Natural (Max_Line_Length)); |
| 419 |
return; |
| 420 |
end if; |
| 421 |
|
| 422 |
Err_Col := Err_Col + 1; |
| 423 |
exit when Err_Col > Options'Last |
| 424 |
or else Options (Err_Col) not in '0' .. '9'; |
| 425 |
end loop; |
| 426 |
|
| 427 |
Style_Check_Max_Line_Length := Style_Max_Line_Length /= 0; |
| 428 |
|
| 429 |
when 'n' => |
| 430 |
Style_Check_Standard := True; |
| 431 |
|
| 432 |
when 'N' => |
| 433 |
Reset_Style_Check_Options; |
| 434 |
|
| 435 |
when 'o' => |
| 436 |
Style_Check_Order_Subprograms := True; |
| 437 |
|
| 438 |
when 'O' => |
| 439 |
Style_Check_Missing_Overriding := True; |
| 440 |
|
| 441 |
when 'p' => |
| 442 |
Style_Check_Pragma_Casing := True; |
| 443 |
|
| 444 |
when 'r' => |
| 445 |
Style_Check_References := True; |
| 446 |
|
| 447 |
when 's' => |
| 448 |
Style_Check_Specs := True; |
| 449 |
|
| 450 |
when 'S' => |
| 451 |
Style_Check_Separate_Stmt_Lines := True; |
| 452 |
|
| 453 |
when 't' => |
| 454 |
Style_Check_Tokens := True; |
| 455 |
|
| 456 |
when 'u' => |
| 457 |
Style_Check_Blank_Lines := True; |
| 458 |
|
| 459 |
when 'x' => |
| 460 |
Style_Check_Xtra_Parens := True; |
| 461 |
|
| 462 |
when 'y' => |
| 463 |
Set_Default_Style_Check_Options; |
| 464 |
|
| 465 |
when 'z' => |
| 466 |
Style_Check_Xtra_Parens_Precedence := True; |
| 467 |
|
| 468 |
when ' ' => |
| 469 |
null; |
| 470 |
|
| 471 |
when others => |
| 472 |
if Ignore_Unrecognized_VWY_Switches then |
| 473 |
Write_Line ("unrecognized switch -gnaty" & C & " ignored"); |
| 474 |
else |
| 475 |
Err_Col := Err_Col - 1; |
| 476 |
Bad_Style_Switch ("invalid style switch"); |
| 477 |
return; |
| 478 |
end if; |
| 479 |
end case; |
| 480 |
|
| 481 |
-- Turning switches off |
| 482 |
|
| 483 |
else |
| 484 |
case C is |
| 485 |
when '+' => |
| 486 |
On := True; |
| 487 |
|
| 488 |
when '-' => |
| 489 |
null; |
| 490 |
|
| 491 |
when '0' .. '9' => |
| 492 |
Style_Check_Indentation := 0; |
| 493 |
|
| 494 |
when 'a' => |
| 495 |
Style_Check_Attribute_Casing := False; |
| 496 |
|
| 497 |
when 'A' => |
| 498 |
Style_Check_Array_Attribute_Index := False; |
| 499 |
|
| 500 |
when 'b' => |
| 501 |
Style_Check_Blanks_At_End := False; |
| 502 |
|
| 503 |
when 'B' => |
| 504 |
Style_Check_Boolean_And_Or := False; |
| 505 |
|
| 506 |
when 'c' | 'C' => |
| 507 |
Style_Check_Comments := False; |
| 508 |
|
| 509 |
when 'd' => |
| 510 |
Style_Check_DOS_Line_Terminator := False; |
| 511 |
|
| 512 |
when 'D' => |
| 513 |
Style_Check_Mixed_Case_Decls := False; |
| 514 |
|
| 515 |
when 'e' => |
| 516 |
Style_Check_End_Labels := False; |
| 517 |
|
| 518 |
when 'f' => |
| 519 |
Style_Check_Form_Feeds := False; |
| 520 |
|
| 521 |
when 'g' => |
| 522 |
Reset_Style_Check_Options; |
| 523 |
|
| 524 |
when 'h' => |
| 525 |
Style_Check_Horizontal_Tabs := False; |
| 526 |
|
| 527 |
when 'i' => |
| 528 |
Style_Check_If_Then_Layout := False; |
| 529 |
|
| 530 |
when 'I' => |
| 531 |
Style_Check_Mode_In := False; |
| 532 |
|
| 533 |
when 'k' => |
| 534 |
Style_Check_Keyword_Casing := False; |
| 535 |
|
| 536 |
when 'l' => |
| 537 |
Style_Check_Layout := False; |
| 538 |
|
| 539 |
when 'L' => |
| 540 |
Style_Max_Nesting_Level := 0; |
| 541 |
Style_Check_Max_Nesting_Level := False; |
| 542 |
|
| 543 |
when 'm' => |
| 544 |
Style_Check_Max_Line_Length := False; |
| 545 |
|
| 546 |
when 'M' => |
| 547 |
Style_Max_Line_Length := 0; |
| 548 |
Style_Check_Max_Line_Length := False; |
| 549 |
|
| 550 |
when 'n' => |
| 551 |
Style_Check_Standard := False; |
| 552 |
|
| 553 |
when 'o' => |
| 554 |
Style_Check_Order_Subprograms := False; |
| 555 |
|
| 556 |
when 'O' => |
| 557 |
Style_Check_Missing_Overriding := False; |
| 558 |
|
| 559 |
when 'p' => |
| 560 |
Style_Check_Pragma_Casing := False; |
| 561 |
|
| 562 |
when 'r' => |
| 563 |
Style_Check_References := False; |
| 564 |
|
| 565 |
when 's' => |
| 566 |
Style_Check_Specs := False; |
| 567 |
|
| 568 |
when 'S' => |
| 569 |
Style_Check_Separate_Stmt_Lines := False; |
| 570 |
|
| 571 |
when 't' => |
| 572 |
Style_Check_Tokens := False; |
| 573 |
|
| 574 |
when 'u' => |
| 575 |
Style_Check_Blank_Lines := False; |
| 576 |
|
| 577 |
when 'x' => |
| 578 |
Style_Check_Xtra_Parens := False; |
| 579 |
|
| 580 |
when 'z' => |
| 581 |
Style_Check_Xtra_Parens_Precedence := False; |
| 582 |
|
| 583 |
when ' ' => |
| 584 |
null; |
| 585 |
|
| 586 |
when others => |
| 587 |
if Ignore_Unrecognized_VWY_Switches then |
| 588 |
Write_Line ("unrecognized switch -gnaty-" & C & " ignored"); |
| 589 |
else |
| 590 |
Err_Col := Err_Col - 1; |
| 591 |
Bad_Style_Switch ("invalid style switch"); |
| 592 |
return; |
| 593 |
end if; |
| 594 |
end case; |
| 595 |
end if; |
| 596 |
end loop; |
| 597 |
|
| 598 |
-- Turn on style checking if other than N at end of string |
| 599 |
|
| 600 |
Style_Check := (Last_Option /= 'N'); |
| 601 |
OK := True; |
| 602 |
end Set_Style_Check_Options; |
| 603 |
end Stylesw; |