mirror of
				https://github.com/ton-blockchain/ton
				synced 2025-03-09 15:40:10 +00:00 
			
		
		
		
	Use td::realpath and add re-inclusion tests
				
					
				
			This commit is contained in:
		
							parent
							
								
									9356a16b84
								
							
						
					
					
						commit
						eb35cf653a
					
				
					 4 changed files with 8 additions and 4 deletions
				
			
		| 
						 | 
					@ -23,7 +23,7 @@
 | 
				
			||||||
#include "block/block.h"
 | 
					#include "block/block.h"
 | 
				
			||||||
#include "block-parse.h"
 | 
					#include "block-parse.h"
 | 
				
			||||||
#include <fstream>
 | 
					#include <fstream>
 | 
				
			||||||
#include <climits>
 | 
					#include "td/utils/port/path.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace sym {
 | 
					namespace sym {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1657,9 +1657,7 @@ bool parse_source_file(const char* filename, src::Lexem lex) {
 | 
				
			||||||
      throw src::Fatal{msg};
 | 
					      throw src::Fatal{msg};
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  char realpath_buf[PATH_MAX] = {0, };
 | 
					  std::string real_filename = td::realpath(td::CSlice(filename)).move_as_ok();
 | 
				
			||||||
  realpath(filename, realpath_buf);
 | 
					 | 
				
			||||||
  std::string real_filename = std::string{realpath_buf};
 | 
					 | 
				
			||||||
  if (std::count(source_files.begin(), source_files.end(), real_filename)) {
 | 
					  if (std::count(source_files.begin(), source_files.end(), real_filename)) {
 | 
				
			||||||
    if (verbosity >= 2) {
 | 
					    if (verbosity >= 2) {
 | 
				
			||||||
      if (lex.tp) {
 | 
					      if (lex.tp) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -12,3 +12,5 @@ global int i;
 | 
				
			||||||
  sub2();
 | 
					  sub2();
 | 
				
			||||||
  i = 9;
 | 
					  i = 9;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "../test/i1sub2.fc";
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,8 @@
 | 
				
			||||||
;; DO NOT COMPILE DIRECTLY!
 | 
					;; DO NOT COMPILE DIRECTLY!
 | 
				
			||||||
;; Compile i1.fc
 | 
					;; Compile i1.fc
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "i1sub1.fc";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
() sub1() impure {
 | 
					() sub1() impure {
 | 
				
			||||||
  i = 1;
 | 
					  i = 1;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,8 @@
 | 
				
			||||||
;; DO NOT COMPILE DIRECTLY!
 | 
					;; DO NOT COMPILE DIRECTLY!
 | 
				
			||||||
;; Compile i1.fc
 | 
					;; Compile i1.fc
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "./i1sub1.fc";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
() sub2() impure {
 | 
					() sub2() impure {
 | 
				
			||||||
  sub1();
 | 
					  sub1();
 | 
				
			||||||
  sub0();
 | 
					  sub0();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue