aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/scanner.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2018-11-16 20:46:09 +0100
committerTristan Gingold <tgingold@free.fr>2018-11-16 20:46:09 +0100
commitad252b4268f855b7df53092826b6f6a57ce4c4e3 (patch)
treea78850bb3cd642048db6bc38ebf16dd1a75af567 /src/vhdl/scanner.adb
parent9624f0ce08849f8cf14fe81416496417b4754d9d (diff)
downloadghdl-ad252b4268f855b7df53092826b6f6a57ce4c4e3.tar.gz
ghdl-ad252b4268f855b7df53092826b6f6a57ce4c4e3.tar.bz2
ghdl-ad252b4268f855b7df53092826b6f6a57ce4c4e3.zip
errorout: split and rework.
Diffstat (limited to 'src/vhdl/scanner.adb')
-rw-r--r--src/vhdl/scanner.adb30
1 files changed, 7 insertions, 23 deletions
diff --git a/src/vhdl/scanner.adb b/src/vhdl/scanner.adb
index 1a5637e21..5d94fd470 100644
--- a/src/vhdl/scanner.adb
+++ b/src/vhdl/scanner.adb
@@ -243,31 +243,15 @@ package body Scanner is
return Current_Context.Line_Number;
end Get_Current_Line;
- function Get_Current_Column return Natural
- is
- Col : Natural;
- Name : Name_Id;
+ function Get_Current_Offset return Natural is
begin
- Coord_To_Position
- (Current_Context.Source_File,
- Current_Context.Line_Pos,
- Integer (Current_Context.Pos - Current_Context.Line_Pos),
- Name, Col);
- return Col;
- end Get_Current_Column;
-
- function Get_Token_Column return Natural
- is
- Col : Natural;
- Name : Name_Id;
+ return Natural (Current_Context.Pos - Current_Context.Line_Pos);
+ end Get_Current_Offset;
+
+ function Get_Token_Offset return Natural is
begin
- Coord_To_Position
- (Current_Context.Source_File,
- Current_Context.Line_Pos,
- Integer (Current_Context.Token_Pos - Current_Context.Line_Pos),
- Name, Col);
- return Col;
- end Get_Token_Column;
+ return Natural (Current_Context.Token_Pos - Current_Context.Line_Pos);
+ end Get_Token_Offset;
function Get_Token_Position return Source_Ptr is
begin