Skip to content

Commit

Permalink
fix(grainfmt): Resolve issues with comments within braces (grain-lang…
Browse files Browse the repository at this point in the history
…#888)

Fix up multiple formatter issues, Tidied up the tests, remove unsafe examples from tests
  • Loading branch information
marcusroberts authored Sep 14, 2021
1 parent e2a33a9 commit 9c88b89
Show file tree
Hide file tree
Showing 12 changed files with 295 additions and 76 deletions.
8 changes: 4 additions & 4 deletions compiler/grainformat/debug.re
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ let print_loc_string = (msg: string, loc: Grain_parsing.Location.t) => {

if (startchar >= 0) {
if (line == endline) {
Printf.sprintf("%s %d:%d,%d", msg, line, startchar, endchar);
Printf.sprintf("%s %d:%d,%d\n", msg, line, startchar, endchar);
} else {
Printf.sprintf(
"%s %d:%d - %d:%d",
"%s %d:%d - %d:%d\n",
msg,
line,
startchar,
Expand All @@ -32,10 +32,10 @@ let print_loc = (msg: string, loc: Grain_parsing.Location.t) => {

if (startchar >= 0) {
if (line == endline) {
Printf.printf("%s %d:%d,%d", msg, line, startchar, endchar);
Printf.printf("%s %d:%d,%d\n", msg, line, startchar, endchar);
} else {
Printf.printf(
"%s %d:%d - %d:%d",
"%s %d:%d - %d:%d\n",
msg,
line,
startchar,
Expand Down
Loading

0 comments on commit 9c88b89

Please sign in to comment.