summaryrefslogtreecommitdiff
path: root/src/getinfo.sml
diff options
context:
space:
mode:
authorGravatar Simon Van Casteren <simon.van.casteren@gmail.com>2020-01-08 12:12:24 +0100
committerGravatar Simon Van Casteren <simon.van.casteren@gmail.com>2020-01-08 12:12:24 +0100
commit028f15cce127360f29afa41754aab3816718492f (patch)
tree16f3c5463b3b3e07dff6d62bb742df3988025f53 /src/getinfo.sml
parentd7ca451f01595ced7cfe70f43714ac2a1150915d (diff)
Fixed smaller review remarks
Diffstat (limited to 'src/getinfo.sml')
-rw-r--r--src/getinfo.sml8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/getinfo.sml b/src/getinfo.sml
index d84f792b..5a0fe752 100644
--- a/src/getinfo.sml
+++ b/src/getinfo.sml
@@ -37,7 +37,7 @@ fun isPosIn (file: string) (row: int) (col: int) (span: ErrorMsg.span) =
val start = #first span
val end_ = #last span
in
- String.isSuffix file (#file span)
+ OS.Path.base file = OS.Path.base (#file span)
andalso
(#line start < row orelse
#line start = row andalso #char start <= col)
@@ -281,7 +281,7 @@ fun getInfo env str fileName {line = row, character = col} =
let
val distanceFromRow = Int.abs (#line (#first (#2 (#3 decl))) - row)
val accDistanceFromRow = case accO of
- NONE => 999
+ NONE => Option.getOpt (Int.maxInt, 99999)
| SOME acc => Int.abs (#line (#first (#2 (#3 acc))) - row)
in
if distanceFromRow < accDistanceFromRow andalso distanceFromRow <= 1
@@ -368,10 +368,10 @@ fun getInfo env str fileName {line = row, character = col} =
{ smallestgoodpart = NONE
, smallest = { item = Str (str, { file = fileName
, first = { line = 0, char = 0}
- , last = { line = 99999, char = 0} })
+ , last = { line = Option.getOpt (Int.maxInt, 99999), char = 0} })
, span = { file = fileName
, first = { line = 0, char = 0}
- , last = { line = 99999, char = 0} }
+ , last = { line = Option.getOpt (Int.maxInt, 99999), char = 0} }
, env = env }
}
( L.DStr (Compiler.moduleOf "fileName", 0, (L.SgnError, ErrorMsg.dummySpan), (str, {file = fileName, first = ErrorMsg.dummyPos, last = ErrorMsg.dummyPos}))