Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some error nits #3682

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/basic/FStarC.Range.Ops.fst
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ let rng_included r1 r2 =
r2.end_pos >=? r1.end_pos

let string_of_pos pos =
format2 "%s,%s" (string_of_int pos.line) (string_of_int pos.col)
format2 "%s.%s" (string_of_int pos.line) (string_of_int pos.col)
let file_of_range r =
let f = r.def_range.file_name in
string_of_file_name f
let set_file_of_range r (f:string) = {r with def_range = {r.def_range with file_name = f}}
let string_of_rng r =
format3 "%s(%s-%s)" (string_of_file_name r.file_name) (string_of_pos r.start_pos) (string_of_pos r.end_pos)
format3 "%s:%s-%s" (string_of_file_name r.file_name) (string_of_pos r.start_pos) (string_of_pos r.end_pos)
let string_of_def_range r = string_of_rng r.def_range
let string_of_use_range r = string_of_rng r.use_range
let string_of_range r = string_of_def_range r
Expand Down
2 changes: 1 addition & 1 deletion src/ml/bare/FStarC_Parser_Util.ml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type bytes = byte array
let parseState = ()

let pos_of_lexpos (p:position) =
mk_pos (Z.of_int p.pos_lnum) (Z.of_int (p.pos_cnum - p.pos_bol))
mk_pos (Z.of_int p.pos_lnum) (Z.of_int (1 + p.pos_cnum - p.pos_bol))

let mksyn_range (p1:position) p2 =
mk_range p1.pos_fname (pos_of_lexpos p1) (pos_of_lexpos p2)
Expand Down
12 changes: 6 additions & 6 deletions src/ml/bare/FStarC_Util.ml
Original file line number Diff line number Diff line change
Expand Up @@ -535,32 +535,32 @@ let colorize s colors =

let colorize_bold s =
match stdout_isatty () with
| Some true -> format3 "%s%s%s" "\x1b[39;1m" s "\x1b[0m"
| Some true -> format3 "%s%s%s" "\x1b[39m" s "\x1b[0m"
| _ -> s

let colorize_red s =
match stdout_isatty () with
| Some true -> format3 "%s%s%s" "\x1b[31;1m" s "\x1b[0m"
| Some true -> format3 "%s%s%s" "\x1b[31m" s "\x1b[0m"
| _ -> s

let colorize_yellow s =
match stdout_isatty () with
| Some true -> format3 "%s%s%s" "\x1b[33;1m" s "\x1b[0m"
| Some true -> format3 "%s%s%s" "\x1b[33m" s "\x1b[0m"
| _ -> s

let colorize_cyan s =
match stdout_isatty () with
| Some true -> format3 "%s%s%s" "\x1b[36;1m" s "\x1b[0m"
| Some true -> format3 "%s%s%s" "\x1b[36m" s "\x1b[0m"
| _ -> s

let colorize_green s =
match stdout_isatty () with
| Some true -> format3 "%s%s%s" "\x1b[32;1m" s "\x1b[0m"
| Some true -> format3 "%s%s%s" "\x1b[32m" s "\x1b[0m"
| _ -> s

let colorize_magenta s =
match stdout_isatty () with
| Some true -> format3 "%s%s%s" "\x1b[35;1m" s "\x1b[0m"
| Some true -> format3 "%s%s%s" "\x1b[35m" s "\x1b[0m"
| _ -> s

let pr = Printf.printf
Expand Down
Loading