| 
									
										
										
										
											2014-07-15 20:34:25 +02:00
										 |  |  | package ethrepl | 
					
						
							| 
									
										
										
										
											2014-05-17 15:15:46 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | import ( | 
					
						
							|  |  |  | 	"bufio" | 
					
						
							|  |  |  | 	"fmt" | 
					
						
							|  |  |  | 	"os" | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | func (self *JSRepl) read() { | 
					
						
							|  |  |  | 	reader := bufio.NewReader(os.Stdin) | 
					
						
							|  |  |  | 	for { | 
					
						
							| 
									
										
										
										
											2014-05-19 13:04:31 +02:00
										 |  |  | 		fmt.Printf(self.prompt) | 
					
						
							| 
									
										
										
										
											2014-05-17 15:15:46 +02:00
										 |  |  | 		str, _, err := reader.ReadLine() | 
					
						
							|  |  |  | 		if err != nil { | 
					
						
							|  |  |  | 			fmt.Println("Error reading input", err) | 
					
						
							|  |  |  | 		} else { | 
					
						
							|  |  |  | 			self.parseInput(string(str)) | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2014-05-19 16:32:45 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | func (self *JSRepl) PrintValue(value otto.Value) { | 
					
						
							|  |  |  | 	fmt.Println(value) | 
					
						
							|  |  |  | } |