Allow bash script header
This commit is contained in:
parent
3214f427ff
commit
5f96b39c08
@ -98,7 +98,7 @@ namespace chaiscript
|
|||||||
}
|
}
|
||||||
catch (EvalError &ee) {
|
catch (EvalError &ee) {
|
||||||
if (filename != std::string("__EVAL__")) {
|
if (filename != std::string("__EVAL__")) {
|
||||||
std::cout << "Eval error: \"" << ee.reason << "\" in '" << ee.location->filename << "' line: " << ee.location->start.line+1 << std::endl;
|
std::cout << "Eval error: \"" << ee.reason << "\" in '" << ee.location->filename << "' line: " << ee.location->start.line << std::endl;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
std::cout << "Eval error: \"" << ee.reason << "\"" << std::endl;
|
std::cout << "Eval error: \"" << ee.reason << "\"" << std::endl;
|
||||||
|
@ -1269,6 +1269,12 @@ namespace chaiscript
|
|||||||
line = 1; col = 1;
|
line = 1; col = 1;
|
||||||
filename = fname;
|
filename = fname;
|
||||||
|
|
||||||
|
if ((input.size() > 0) && (input[0] == '#')) {
|
||||||
|
while ((input_pos != input_end) && (!Eol())) {
|
||||||
|
++input_pos;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (Statements()) {
|
if (Statements()) {
|
||||||
if (input_pos != input_end) {
|
if (input_pos != input_end) {
|
||||||
throw Parse_Error("Unparsed input", File_Position(line, col), fname);
|
throw Parse_Error("Unparsed input", File_Position(line, col), fname);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user