nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge: src/model: fix mdoc_or_fallback for MClasses and MProperties
[nit.git]
/
src
/
location.nit
diff --git
a/src/location.nit
b/src/location.nit
index
786ffc2
..
99083ad
100644
(file)
--- a/
src/location.nit
+++ b/
src/location.nit
@@
-140,6
+140,15
@@
class Location
end
end
end
end
+ # Initialize a location corresponding to an opaque file.
+ #
+ # The path is used as is and is not open nor read.
+ init opaque_file(path: String)
+ do
+ var source = new SourceFile.from_string(path, "")
+ init(source, 0, 0, 0, 0)
+ end
+
# The index in the start character in the source
fun pstart: Int do return file.line_starts[line_start-1] + column_start-1
# The index in the start character in the source
fun pstart: Int do return file.line_starts[line_start-1] + column_start-1
@@
-246,7
+255,7
@@
class Location
# * `"0;32"` for green
fun colored_line(color: String): String
do
# * `"0;32"` for green
fun colored_line(color: String): String
do
- var esc = 27.ascii
+ var esc = 27.code_point
var def = "{esc}[0m"
var col = "{esc}[{color}m"
var def = "{esc}[0m"
var col = "{esc}[{color}m"