File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 1
1
module calcool.app ;
2
+
2
3
version (CLI_APP) {
3
4
import std.stdio ;
4
5
import std.getopt ;
Original file line number Diff line number Diff line change 1
1
module calcool.lexer ;
2
2
import std.stdio ;
3
3
import std.ascii ;
4
-
5
4
import calcool.token;
6
5
import calcool.exceptions;
7
6
8
7
public class Lexer {
9
8
private :
10
9
File input;
10
+
11
11
uint pos = 0 ;
12
12
string line;
13
13
public :
@@ -21,8 +21,17 @@ public:
21
21
22
22
Token [] nextLine (in string stringInput = null ) {
23
23
if (stringInput is null ) {
24
- if (input is stdin)
25
- write(" >> " );
24
+ if (input is stdin) {
25
+ version (Posix ) {
26
+ import core.sys.posix.unistd : isatty;
27
+
28
+ if (isatty(stdin.fileno))
29
+ write(" >> " );
30
+ } else {
31
+ write(" >> " );
32
+ }
33
+ }
34
+
26
35
line = input.readln();
27
36
if (line is null ) {
28
37
return [];
You can’t perform that action at this time.
0 commit comments