-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Langkit_Support.Symbols: fix Get_Symbol for null symbols
When symbol canonicalization fails, $.Lexer_Implementation.Force_Symbol calls Get_Symbol passing to it No_Thin_Symbol, so Get_Symbol needs to support this case. TN: T923-007
- Loading branch information
Showing
6 changed files
with
38 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package body Pkg is | ||
|
||
------------------ | ||
-- Canonicalize -- | ||
------------------ | ||
|
||
function Canonicalize (Name : Text_Type) return Symbolization_Result is | ||
pragma Unreferenced (Name); | ||
begin | ||
return Create_Error ("no symbol allowed"); | ||
end Canonicalize; | ||
|
||
end Pkg; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
with Langkit_Support.Text; use Langkit_Support.Text; | ||
with Libfoolang.Common; use Libfoolang.Common; | ||
|
||
package Pkg is | ||
|
||
function Canonicalize (Name : Text_Type) return Symbolization_Result; | ||
|
||
end Pkg; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
main.py: Running... | ||
p_prop(None) = <PropertyError: cannot get the symbol of a null node> | ||
p_prop(<Example main.txt:1:1-1:8>) = '' | ||
main.py: Done. | ||
Done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters