@@ -31,6 +31,8 @@ use crate::FileAnalyzer;
3131use crate :: StackGraphLanguage ;
3232use crate :: FILE_PATH_VAR ;
3333
34+ const BUILTINS_FILENAME : & str = "<builtins>" ;
35+
3436pub static DEFAULT_TSG_PATHS : Lazy < Vec < LoadPath > > =
3537 Lazy :: new ( || vec ! [ LoadPath :: Grammar ( "queries/stack-graphs" . into( ) ) ] ) ;
3638pub static DEFAULT_BUILTINS_PATHS : Lazy < Vec < LoadPath > > =
@@ -77,18 +79,14 @@ impl LanguageConfiguration {
7779 if let Some ( ( builtins_path, builtins_source) ) = builtins_source {
7880 let mut builtins_globals = Variables :: new ( ) ;
7981
80- let builtins_path_var = Path :: new ( "<builtins>" ) ;
8182 builtins_globals
82- . add (
83- FILE_PATH_VAR . into ( ) ,
84- builtins_path_var. to_str ( ) . unwrap ( ) . into ( ) ,
85- )
83+ . add ( FILE_PATH_VAR . into ( ) , BUILTINS_FILENAME . into ( ) )
8684 . expect ( "failed to add file path variable" ) ;
8785
8886 if let Some ( builtins_config) = builtins_config {
8987 Loader :: load_globals_from_config_str ( builtins_config, & mut builtins_globals) ?;
9088 }
91- let file = builtins. add_file ( "<builtins>" ) . unwrap ( ) ;
89+ let file = builtins. add_file ( BUILTINS_FILENAME ) . unwrap ( ) ;
9290 sgl. build_stack_graph_into (
9391 & mut builtins,
9492 file,
@@ -341,7 +339,7 @@ impl Loader {
341339 let mut globals = Variables :: new ( ) ;
342340
343341 globals
344- . add ( FILE_PATH_VAR . into ( ) , path . to_str ( ) . unwrap ( ) . into ( ) )
342+ . add ( FILE_PATH_VAR . into ( ) , BUILTINS_FILENAME . into ( ) )
345343 . expect ( "failed to add file path variable" ) ;
346344
347345 Self :: load_globals_from_config_str ( & config, & mut globals) ?;
0 commit comments