Skip to content

Commit 468f99b

Browse files
committed
pancake parser: change annotation concrete syntax for preprocessing
1 parent 4dea053 commit 468f99b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pancake/parser/panConcreteExamplesScript.sml

+2-2
Original file line numberDiff line numberDiff line change
@@ -466,11 +466,11 @@ val empty_body_parse = check_success $ parse_pancake empty_blocks;
466466
val annot_fun =
467467
`
468468
/* this is a function with an annot-comment in it */
469-
/*@ and also an annot-comment before it @*/
469+
/@ and also an annot-comment before it @/
470470
fun f () {
471471
var x = 1;
472472
var y = 2;
473-
/*@ good place to check y - x == 1 @*/
473+
/@ good place to check y - x == 1 @/
474474
var z = x + y;
475475
return z;
476476
}

pancake/parser/panLexerScript.sml

+2-2
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ Definition skip_block_comment_def:
199199
skip_block_comment "" _ _ = NONE
200200
skip_block_comment [_] _ _ = NONE
201201
skip_block_comment (x::y::xs) loc i =
202-
if x = #"*" ∧ y = #"/" then
202+
if (x = #"*" ∧ y = #"/") ∨ (x = #"@" ∧ y = #"/") then
203203
SOME (next_loc 2 loc, i, i + 2)
204204
else if x = #"\n" then
205205
skip_block_comment (y::xs) (next_line loc) (i + 1n)
@@ -236,7 +236,7 @@ Definition next_atom_def:
236236
(case (skip_comment (TL cs) (next_loc 2 loc) 0n) of
237237
| NONE => SOME (ErrA «Malformed comment», Locs loc (next_loc 2 loc), "")
238238
| SOME (loc', len) => next_atom (DROP (len + 1) cs) loc')
239-
else if isPREFIX "/*@" (c::cs) then (* annotation block comment *)
239+
else if isPREFIX "/@" (c::cs) then (* annotation block comment *)
240240
(case (skip_block_comment (TL cs) (next_loc 3 loc) 0n) of
241241
| NONE => SOME (ErrA «Malformed comment», Locs loc (next_loc 3 loc), "")
242242
| SOME (loc', i, len) => SOME (AnnotCommentA (TAKE i (TL cs)),

0 commit comments

Comments
 (0)