Changed the line comments to start with "//". The list constructor is now "#".

This commit is contained in:
Christian Rinderknecht 2019-03-08 16:06:50 +01:00
parent 09f790680f
commit 00a255aa9e
No known key found for this signature in database
GPG Key ID: 9446816CFD267040
3 changed files with 7 additions and 7 deletions

View File

@ -246,7 +246,7 @@ let to_lexeme = function
| RBRACE _ -> "}" | RBRACE _ -> "}"
| LBRACKET _ -> "[" | LBRACKET _ -> "["
| RBRACKET _ -> "]" | RBRACKET _ -> "]"
| CONS _ -> "<:" | CONS _ -> "#"
| VBAR _ -> "|" | VBAR _ -> "|"
| ARROW _ -> "->" | ARROW _ -> "->"
| ASS _ -> ":=" | ASS _ -> ":="
@ -490,7 +490,7 @@ let mk_sym lexeme region =
| "}" -> RBRACE region | "}" -> RBRACE region
| "[" -> LBRACKET region | "[" -> LBRACKET region
| "]" -> RBRACKET region | "]" -> RBRACKET region
| "<:" -> CONS region | "#" -> CONS region
| "|" -> VBAR region | "|" -> VBAR region
| "->" -> ARROW region | "->" -> ARROW region
| ":=" -> ASS region | ":=" -> ASS region

View File

@ -166,7 +166,7 @@ module Make (Token: TOKEN) : (S with module Token = Token) =
(* When scanning structured constructs, like strings and comments, (* When scanning structured constructs, like strings and comments,
we need to keep the region of the opening symbol (like double we need to keep the region of the opening symbol (like double
quote, "#" or "(*") in order to report any error more quote, "//" or "(*") in order to report any error more
precisely. Since ocamllex is byte-oriented, we need to store precisely. Since ocamllex is byte-oriented, we need to store
the parsed bytes as characters in an accumulator [acc] and the parsed bytes as characters in an accumulator [acc] and
also its length [len], so, we are done, it is easy to build the also its length [len], so, we are done, it is easy to build the
@ -443,7 +443,7 @@ let esc = "\\n" | "\\\"" | "\\\\" | "\\b"
| "\\r" | "\\t" | "\\x" byte | "\\r" | "\\t" | "\\x" byte
let symbol = ';' | ',' let symbol = ';' | ','
| '(' | ')' | '{' | '}' | '[' | ']' | '(' | ')' | '{' | '}' | '[' | ']'
| "<:" | '|' | "->" | ":=" | '=' | ':' | "#" | '|' | "->" | ":=" | '=' | ':'
| "||" | "&&" | '<' | "<=" | '>' | ">=" | "=/=" | "||" | "&&" | '<' | "<=" | '>' | ">=" | "=/="
| '+' | '-' | '*' | '.' | '_' | '^' | '+' | '-' | '*' | '.' | '_' | '^'
@ -482,8 +482,8 @@ and scan state = parse
let state = scan_block thread state lexbuf |> push_block let state = scan_block thread state lexbuf |> push_block
in scan state lexbuf } in scan state lexbuf }
| '#' { let opening, _, state = sync state lexbuf in | "//" { let opening, _, state = sync state lexbuf in
let thread = {opening; len=1; acc=['#']} in let thread = {opening; len=2; acc=['/';'/']} in
let state = scan_line thread state lexbuf |> push_line let state = scan_line thread state lexbuf |> push_line
in scan state lexbuf } in scan state lexbuf }

View File

@ -3,7 +3,7 @@ type u is t
type v is record foo: key; bar: mutez; baz: address end type v is record foo: key; bar: mutez; baz: address end
type w is K of (U of int) (*v * u*) type w is K of (U of int) (*v * u*)
parameter p : v // Line comment parameter p : v; // Line comment
storage w storage w
operations u operations u