* Don't use the ATerm library for parsing/printing .drv files.
This commit is contained in:
		
							parent
							
								
									55b5ddd3ca
								
							
						
					
					
						commit
						efc7a579e8
					
				
					 14 changed files with 174 additions and 330 deletions
				
			
		|  | @ -25,33 +25,6 @@ DrvInfos queryInstalled(EvalState & state, const Path & userEnv) | |||
| 
 | ||||
| /* Code for parsing manifests in the old textual ATerm format. */ | ||||
| 
 | ||||
| static void expect(std::istream & str, const string & s) | ||||
| { | ||||
|     char s2[s.size()]; | ||||
|     str.read(s2, s.size()); | ||||
|     if (string(s2, s.size()) != s) | ||||
|         throw Error(format("expected string `%1%'") % s); | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| static string parseString(std::istream & str) | ||||
| { | ||||
|     string res; | ||||
|     expect(str, "\""); | ||||
|     int c; | ||||
|     while ((c = str.get()) != '"') | ||||
|         if (c == '\\') { | ||||
|             c = str.get(); | ||||
|             if (c == 'n') res += '\n'; | ||||
|             else if (c == 'r') res += '\r'; | ||||
|             else if (c == 't') res += '\t'; | ||||
|             else res += c; | ||||
|         } | ||||
|         else res += c; | ||||
|     return res; | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| static string parseStr(std::istream & str) | ||||
| { | ||||
|     expect(str, "Str("); | ||||
|  | @ -70,20 +43,6 @@ static string parseWord(std::istream & str) | |||
| } | ||||
| 
 | ||||
| 
 | ||||
| static bool endOfList(std::istream & str) | ||||
| { | ||||
|     if (str.peek() == ',') { | ||||
|         str.get(); | ||||
|         return false; | ||||
|     } | ||||
|     if (str.peek() == ']') { | ||||
|         str.get(); | ||||
|         return true; | ||||
|     } | ||||
|     return false; | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| static MetaInfo parseMeta(std::istream & str) | ||||
| { | ||||
|     MetaInfo meta; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue