@@ -435,10 +435,16 @@ static SCOPE_ATTRS: Lazy<HashSet<&'static str>> =
435435static PRECEDENCE_ATTR : & ' static str = "precedence" ;
436436
437437// Global variables
438- static ROOT_NODE_VAR : & ' static str = "ROOT_NODE" ;
439- static JUMP_TO_SCOPE_NODE_VAR : & ' static str = "JUMP_TO_SCOPE_NODE" ;
440- static FILE_PATH_VAR : & ' static str = "FILE_PATH" ;
441- static ROOT_PATH_VAR : & ' static str = "ROOT_PATH" ;
438+ /// Name of the variable used to pass the root node.
439+ pub const ROOT_NODE_VAR : & ' static str = "ROOT_NODE" ;
440+ /// Name of the variable used to pass the jump-to-scope node.
441+ pub const JUMP_TO_SCOPE_NODE_VAR : & ' static str = "JUMP_TO_SCOPE_NODE" ;
442+ /// Name of the variable used to pass the file path.
443+ /// If a root path is given, it should be a descendant the root path.
444+ pub const FILE_PATH_VAR : & ' static str = "FILE_PATH" ;
445+ /// Name of the variable used to pass the root path.
446+ /// If given, should be an ancestor of the file path.
447+ pub const ROOT_PATH_VAR : & ' static str = "ROOT_PATH" ;
442448
443449/// Holds information about how to construct stack graphs for a particular language.
444450pub struct StackGraphLanguage {
@@ -649,11 +655,6 @@ impl<'a> Builder<'a> {
649655 . add ( JUMP_TO_SCOPE_NODE_VAR . into ( ) , jump_to_scope_node. into ( ) )
650656 . expect ( "Failed to set JUMP_TO_SCOPE_NODE" ) ;
651657
652- // FILE_PATH is mandatory
653- globals
654- . get ( & FILE_PATH_VAR . into ( ) )
655- . expect ( "FILE_PATH not set" ) ;
656-
657658 let mut config = ExecutionConfig :: new ( & self . sgl . functions , & globals)
658659 . lazy ( true )
659660 . debug_attributes (
0 commit comments