Merge pull request #2804 from dnmfarrell/line-count-off-by-one
Line numbers start at 1
This commit is contained in:
@@ -210,7 +210,8 @@ load_loop(Stream, Evacuable) :-
|
|||||||
'$conclude_load'(Evacuable)
|
'$conclude_load'(Evacuable)
|
||||||
; var(Term) ->
|
; var(Term) ->
|
||||||
instantiation_error(load/1)
|
instantiation_error(load/1)
|
||||||
; warn_about_singletons(Singletons, LinesRead),
|
; LineNum is LinesRead + 1,
|
||||||
|
warn_about_singletons(Singletons, LineNum),
|
||||||
compile_term(Term, Evacuable),
|
compile_term(Term, Evacuable),
|
||||||
load_loop(Stream, Evacuable)
|
load_loop(Stream, Evacuable)
|
||||||
).
|
).
|
||||||
|
|||||||
@@ -42,14 +42,14 @@ $ scryer-prolog -f --no-add-history tests-pl/invalid_decl7.pl -g halt
|
|||||||
|
|
||||||
```trycmd
|
```trycmd
|
||||||
$ scryer-prolog -f --no-add-history tests-pl/invalid_decl8.pl -g halt
|
$ scryer-prolog -f --no-add-history tests-pl/invalid_decl8.pl -g halt
|
||||||
% Warning: singleton variables Var at line 0 of invalid_decl8.pl
|
% Warning: singleton variables Var at line 1 of invalid_decl8.pl
|
||||||
error(domain_error(operator_specifier,todo_insert_invalid_term_here),load/1).
|
error(domain_error(operator_specifier,todo_insert_invalid_term_here),load/1).
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
```trycmd
|
```trycmd
|
||||||
$ scryer-prolog -f --no-add-history tests-pl/invalid_decl9.pl -g halt
|
$ scryer-prolog -f --no-add-history tests-pl/invalid_decl9.pl -g halt
|
||||||
% Warning: singleton variables Var at line 0 of invalid_decl9.pl
|
% Warning: singleton variables Var at line 1 of invalid_decl9.pl
|
||||||
error(type_error(integer,todo_insert_invalid_term_here),load/1).
|
error(type_error(integer,todo_insert_invalid_term_here),load/1).
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -63,7 +63,7 @@ FIXME I belive the following test should result in a `error(instantiation_error,
|
|||||||
|
|
||||||
```trycmd
|
```trycmd
|
||||||
$ scryer-prolog -f --no-add-history tests-pl/invalid_decl11.pl -g halt
|
$ scryer-prolog -f --no-add-history tests-pl/invalid_decl11.pl -g halt
|
||||||
% Warning: singleton variables Var at line 0 of invalid_decl11.pl
|
% Warning: singleton variables Var at line 1 of invalid_decl11.pl
|
||||||
error(type_error(list,todo_insert_invalid_term_here),load/1).
|
error(type_error(list,todo_insert_invalid_term_here),load/1).
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -101,7 +101,7 @@ $ scryer-prolog -f --no-add-history tests-pl/invalid_decl16.pl -g halt
|
|||||||
|
|
||||||
```trycmd
|
```trycmd
|
||||||
$ scryer-prolog -f --no-add-history tests-pl/invalid_decl_issue2467.pl -g halt
|
$ scryer-prolog -f --no-add-history tests-pl/invalid_decl_issue2467.pl -g halt
|
||||||
% Warning: singleton variables D at line 0 of invalid_decl_issue2467.pl
|
% Warning: singleton variables D at line 1 of invalid_decl_issue2467.pl
|
||||||
error(instantiation_error,load/1).
|
error(instantiation_error,load/1).
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ fn cli_tests() {
|
|||||||
trycmd::TestCases::new()
|
trycmd::TestCases::new()
|
||||||
.default_bin_name("scryer-prolog")
|
.default_bin_name("scryer-prolog")
|
||||||
.case("tests/scryer/cli/issues/*.toml")
|
.case("tests/scryer/cli/issues/*.toml")
|
||||||
.skip("tests/scryer/cli/issues/singleton_warning.toml") // wrong line number
|
|
||||||
.case("tests/scryer/cli/src_tests/*.toml")
|
.case("tests/scryer/cli/src_tests/*.toml")
|
||||||
.case("tests/scryer/cli/src_tests/*.md");
|
.case("tests/scryer/cli/src_tests/*.md");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user