1
- # Bootstrap of Extended Covariant Script Generator v1.5.2
1
+ # Bootstrap of Extended Covariant Script Generator v1.5.3
2
2
#
3
3
# Licensed under the Apache License, Version 2.0 (the "License");
4
4
# you may not use this file except in compliance with the License.
@@ -23,7 +23,7 @@ package ecs_bootstrap
23
23
import parsergen, ecs_parser, ecs_generator, codec, regex
24
24
import sdk_extension as sdk
25
25
26
- var wrapper_ver = "1.5.2 "
26
+ var wrapper_ver = "1.5.3 "
27
27
28
28
function show_version_simple()
29
29
@begin
@@ -45,7 +45,7 @@ class repl_instance
45
45
function on_eof_hook(parser)
46
46
var tokens = null
47
47
loop
48
- tokens = this.readline("..> ")
48
+ tokens = this.readline(".. ")
49
49
until tokens != null
50
50
foreach it in tokens do parser.lex.push_back(it)
51
51
return true
@@ -57,10 +57,13 @@ class repl_instance
57
57
codegen.minmal = true
58
58
end
59
59
function readline(prompt)
60
- if !silent
61
- system.out.print(prompt)
62
- end
63
- var line = repl_impl.readline()
60
+ var line = null
61
+ loop
62
+ if !silent
63
+ system.out.print(prompt)
64
+ end
65
+ line = repl_impl.readline()
66
+ until line != null
64
67
code_buff.push_back(line)
65
68
if line == "@exit"
66
69
system.exit(0)
@@ -96,7 +99,7 @@ class repl_instance
96
99
loop
97
100
var tokens = null
98
101
loop
99
- tokens = this.readline("> ")
102
+ tokens = this.readline(">> ")
100
103
until tokens != null
101
104
if parser.run(ecs_parser.grammar.stx, tokens)
102
105
var ast = parser.production()
@@ -107,9 +110,13 @@ class repl_instance
107
110
try
108
111
foreach line in code
109
112
if !repl_impl.exec(line)
110
- system.exit(0)
113
+ repl_impl.reset()
114
+ break
111
115
end
112
116
end
117
+ if repl_impl.has_exited()
118
+ system.exit(0)
119
+ end
113
120
catch e
114
121
system.out.println(e.what)
115
122
repl_impl.reset()
0 commit comments