-- every file, then we could use the encoding of the initial specified
-- file, but this information is passed only for potential main
-- programs. We could fix this sometime, but it is a very minor point
- -- (wide character default encoding for [Wide_[Wide_]Text_IO when there
+ -- (wide character default encoding for [Wide_[Wide_]]Text_IO when there
-- is no main program).
elsif No_Main_Subprogram then
-- --
-- B o d y --
-- --
--- Copyright (C) 1998-2014, Free Software Foundation, Inc. --
+-- Copyright (C) 1998-2016, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- Test for presence of BOM
- Read_BOM (Buffer.all, BOM_Length, BOM, False);
+ Read_BOM (Buffer.all, BOM_Length, BOM, XML_Support => False);
BOM_Present := BOM /= Unknown;
-- Only chop those units that come from this file
-- --
-- S p e c --
-- --
--- Copyright (C) 2011-2013, Free Software Foundation, Inc. --
+-- Copyright (C) 2011-2016, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
Ampere => -1,
others => 0);
+ -- Note the type punning below. The Symbol is a single "ohm" character
+ -- encoded in UTF-8 (ce a9 in hexadecimal), but this file is not compiled
+ -- with -gnatW8, so we're treating the string literal as a two-character
+ -- String.
+
subtype Electric_Resistance is Mks_Type
with
Dimension => (Symbol => "Ω",
when WCEM_Brackets =>
-- Values in the range 0-255 are directly output. Note that there
- -- is some issue with [ (16#5B#] since this will cause confusion
+ -- is an issue with [ (16#5B#) since this will cause confusion
-- if the resulting string is interpreted using brackets encoding.
-- One possibility would be to always output [ as ["5B"] but in
Tst (J) := C;
end loop;
- Read_BOM (Tst, Len, BOM, False);
+ Read_BOM (Tst, Len, BOM, XML_Support => False);
case BOM is
when UTF8_All =>
Scan_Ptr := Scan_Ptr + Source_Ptr (Len);
+ First_Non_Blank_Location := Scan_Ptr;
+ Current_Line_Start := Scan_Ptr;
Wide_Character_Encoding_Method := WCEM_UTF8;
Upper_Half_Encoding := True;
-- the start of the current source. If the current source starts with a
-- recognized BOM, then some flags such as Wide_Character_Encoding_Method
-- are set accordingly, and the Scan_Ptr on return points past this BOM.
- -- An error message is output and Unrecoverable_Error raised if a non-
- -- recognized BOM is detected. The call has no effect if no BOM is found.
+ -- An error message is output and Unrecoverable_Error raised if an
+ -- unrecognized BOM is detected. The call has no effect if no BOM is found.
function Get_Column_Number (P : Source_Ptr) return Column_Number;
-- The ones-origin column number of the specified Source_Ptr value is
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2015, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2016, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- Start of processing for Check_Comment
begin
- -- Can never have a non-blank character preceding the first minus
+ -- Can never have a non-blank character preceding the first minus.
+ -- The "+ 3" is to leave room for a possible byte order mark (BOM);
+ -- we want to avoid a warning for a comment at the start of the
+ -- file just after the BOM.
if Style_Check_Comments then
- if Scan_Ptr > Source_First (Current_Source_File)
+ if Scan_Ptr > Source_First (Current_Source_File) + 3
and then Source (Scan_Ptr - 1) > ' '
then
Error_Msg_S -- CODEFIX