11use foundry_compilers_core:: utils;
22use semver:: VersionReq ;
3- use solar_parse:: { ast, interface:: sym} ;
4- use solar_sema:: interface;
3+ use solar:: {
4+ parse:: { ast, interface:: sym} ,
5+ sema:: interface,
6+ } ;
57use std:: {
68 ops:: Range ,
79 path:: { Path , PathBuf } ,
810} ;
911
1012/// Solidity parser.
1113///
12- /// Holds a [`solar_sema ::Compiler`] that is used to parse sources incrementally.
14+ /// Holds a [`solar::sema ::Compiler`] that is used to parse sources incrementally.
1315/// After project compilation ([`Graph::resolve`]), this will contain all sources parsed by
1416/// [`Graph`].
1517///
@@ -20,13 +22,13 @@ use std::{
2022#[ derive( derive_more:: Debug ) ]
2123pub struct SolParser {
2224 #[ debug( ignore) ]
23- pub ( crate ) compiler : solar_sema :: Compiler ,
25+ pub ( crate ) compiler : solar :: sema :: Compiler ,
2426}
2527
2628impl Clone for SolParser {
2729 fn clone ( & self ) -> Self {
2830 Self {
29- compiler : solar_sema :: Compiler :: new ( Self :: session_with_opts (
31+ compiler : solar :: sema :: Compiler :: new ( Self :: session_with_opts (
3032 self . compiler . sess ( ) . opts . clone ( ) ,
3133 ) ) ,
3234 }
@@ -35,24 +37,24 @@ impl Clone for SolParser {
3537
3638impl SolParser {
3739 /// Returns a reference to the compiler.
38- pub fn compiler ( & self ) -> & solar_sema :: Compiler {
40+ pub fn compiler ( & self ) -> & solar :: sema :: Compiler {
3941 & self . compiler
4042 }
4143
4244 /// Returns a mutable reference to the compiler.
43- pub fn compiler_mut ( & mut self ) -> & mut solar_sema :: Compiler {
45+ pub fn compiler_mut ( & mut self ) -> & mut solar :: sema :: Compiler {
4446 & mut self . compiler
4547 }
4648
4749 /// Consumes the parser and returns the compiler.
48- pub fn into_compiler ( self ) -> solar_sema :: Compiler {
50+ pub fn into_compiler ( self ) -> solar :: sema :: Compiler {
4951 self . compiler
5052 }
5153
5254 pub ( crate ) fn session_with_opts (
53- opts : solar_sema :: interface:: config:: Opts ,
54- ) -> solar_sema :: interface:: Session {
55- let sess = solar_sema :: interface:: Session :: builder ( )
55+ opts : solar :: sema :: interface:: config:: Opts ,
56+ ) -> solar :: sema :: interface:: Session {
57+ let sess = solar :: sema :: interface:: Session :: builder ( )
5658 . with_buffer_emitter ( Default :: default ( ) )
5759 . opts ( opts)
5860 . build ( ) ;
@@ -137,8 +139,8 @@ impl SolData {
137139 }
138140
139141 pub ( crate ) fn parse_from (
140- sess : & solar_sema :: interface:: Session ,
141- s : & solar_sema :: Source < ' _ > ,
142+ sess : & solar :: sema :: interface:: Session ,
143+ s : & solar :: sema :: Source < ' _ > ,
142144 ) -> Self {
143145 let content = s. file . src . as_str ( ) ;
144146 let file = s. file . name . as_real ( ) . unwrap ( ) ;
@@ -189,7 +191,7 @@ impl SolDataBuilder {
189191 content : & str ,
190192 file : & Path ,
191193 ast : Result <
192- ( & solar_sema :: interface:: Session , & solar_parse :: ast:: SourceUnit < ' _ > ) ,
194+ ( & solar :: sema :: interface:: Session , & solar :: parse :: ast:: SourceUnit < ' _ > ) ,
193195 Option < String > ,
194196 > ,
195197 ) -> SolData {
@@ -208,8 +210,8 @@ impl SolDataBuilder {
208210
209211 fn parse_from_ast (
210212 & mut self ,
211- sess : & solar_sema :: interface:: Session ,
212- ast : & solar_parse :: ast:: SourceUnit < ' _ > ,
213+ sess : & solar :: sema :: interface:: Session ,
214+ ast : & solar :: parse :: ast:: SourceUnit < ' _ > ,
213215 ) {
214216 for item in ast. items . iter ( ) {
215217 let loc = sess. source_map ( ) . span_to_source ( item. span ) . unwrap ( ) . 1 ;
0 commit comments