Changed the line comments to start with "//". The list constructor is now "#".
This commit is contained in:
parent
09f790680f
commit
00a255aa9e
@ -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
|
||||||
|
@ -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 }
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user