summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Gingold2015-12-22 09:10:29 +0100
committerTristan Gingold2015-12-22 09:10:29 +0100
commitf846541d8f10a9098b70716c79f4e262abad71ff (patch)
tree3662b151ee58666e3b8d7a86dc8c1b6558dd52fd
parent23f5d6177cdca86aaf69eb58e2d25971db194059 (diff)
downloadghdl-f846541d8f10a9098b70716c79f4e262abad71ff.tar.gz
ghdl-f846541d8f10a9098b70716c79f4e262abad71ff.tar.bz2
ghdl-f846541d8f10a9098b70716c79f4e262abad71ff.zip
Scanner: fix use of latin-1 8 bit characters.
-rw-r--r--src/ortho/llvm/Makefile2
-rw-r--r--src/vhdl/parse.adb7
-rw-r--r--src/vhdl/scanner.adb7
3 files changed, 7 insertions, 9 deletions
diff --git a/src/ortho/llvm/Makefile b/src/ortho/llvm/Makefile
index a9a9bdc..0e45d6b 100644
--- a/src/ortho/llvm/Makefile
+++ b/src/ortho/llvm/Makefile
@@ -14,7 +14,7 @@ $(ortho_exec): $(ortho_srcdir)/llvm/ortho_llvm.ads force llvm-cbindings.o
`$(LLVM_CONFIG) --ldflags --libs --system-libs` $(LDFLAGS)
llvm-cbindings.o: $(ortho_srcdir)/llvm/llvm-cbindings.cpp
- $(CXX) -c -I`$(LLVM_CONFIG) --includedir --cflags --cxxflags` -o $@ $<
+ $(CXX) -c -I`$(LLVM_CONFIG) --includedir --cflags --cxxflags` -o $@ $<
clean:
$(RM) -f *.o *.ali ortho_code_main
diff --git a/src/vhdl/parse.adb b/src/vhdl/parse.adb
index b3a8cd9..cb8537e 100644
--- a/src/vhdl/parse.adb
+++ b/src/vhdl/parse.adb
@@ -209,7 +209,7 @@ package body Parse is
-- precond : next token
-- postcond: next token.
--
- -- [§ 4.3.2 ]
+ -- [ LRM93 4.3.2 ]
-- mode ::= IN | OUT | INOUT | BUFFER | LINKAGE
--
-- If there is no mode, DEFAULT is returned.
@@ -238,9 +238,8 @@ package body Parse is
Scan;
return Iir_Buffer_Mode;
when others =>
- Error_Msg_Parse
- ("mode is 'in', 'out', 'inout', 'buffer' or 'linkage'");
- return Iir_In_Mode;
+ -- Cannot happen.
+ raise Internal_Error;
end case;
end Parse_Mode;
diff --git a/src/vhdl/scanner.adb b/src/vhdl/scanner.adb
index 84efbe4..2eeac14 100644
--- a/src/vhdl/scanner.adb
+++ b/src/vhdl/scanner.adb
@@ -336,9 +336,9 @@ package body Scanner is
Offset: Natural;
File_Entry : Source_File_Entry;
begin
- if Current_Context.Source = null then
- raise Internal_Error;
- end if;
+ -- Scanner must have been initialized.
+ pragma Assert (Current_Context.Source /= null);
+
Current_Token := Tok_Invalid;
Current_Context.Pos := Position;
Loc := File_Pos_To_Location (Current_Context.Source_File,
@@ -793,7 +793,6 @@ package body Scanner is
if Vhdl_Std = Vhdl_87 then
Error_8bit;
end if;
- Len := Len + 1;
C := Ada.Characters.Handling.To_Lower (C);
when Digit =>
raise Internal_Error;