Change ~= to |= for the programmative style

This commit is contained in:
Nicolas Chataing 2020-08-04 12:38:49 +02:00
parent 32527855f0
commit 623abf1a4e
5 changed files with 16 additions and 16 deletions

View File

@ -261,7 +261,7 @@ let get_subscope_uid (scope_uid : uid) (ctxt : context) ((y, pos) : ident Pos.ma
| _ ->
let err_msg =
Printf.sprintf "Identifier \"%s\" should be a subscope, but it isn't\n%s" y
(Pos.to_string pos)
(Pos.retrieve_loc_text pos)
in
Errors.context_error err_msg )

View File

@ -25,7 +25,7 @@ let update_acc (lexbuf : lexbuf) : unit = code_string_acc := !code_string_acc ^
let token_list : (string * token) list =
[
("scope", SCOPE);
("~", CONSEQUENCE);
("|", CONSEQUENCE);
("data", DATA);
("depends on", DEPENDS);
("declaration", DECLARATION);
@ -67,8 +67,8 @@ let token_list : (string * token) list =
("such", SUCH);
("that", THAT);
("now", NOW);
("and", AND);
("or", OR);
("&&", AND);
("||", OR);
("not", NOT);
("number", CARDINAL);
("year", YEAR);
@ -163,9 +163,6 @@ let rec lex_code (lexbuf : lexbuf) : token =
| "if" ->
update_acc lexbuf;
IF
| "~" ->
update_acc lexbuf;
CONSEQUENCE
| "then" ->
update_acc lexbuf;
THEN
@ -227,15 +224,18 @@ let rec lex_code (lexbuf : lexbuf) : token =
| "now" ->
update_acc lexbuf;
NOW
| "and" ->
| "&&" ->
update_acc lexbuf;
AND
| "or" ->
| "||" ->
update_acc lexbuf;
OR
| "not" ->
update_acc lexbuf;
NOT
| "|" ->
update_acc lexbuf;
CONSEQUENCE
| "number" ->
update_acc lexbuf;
CARDINAL

View File

@ -5,6 +5,6 @@ declaration scope TestBool :
scope TestBool :
def bar = 1
def foo ? bar >= 0 ~= true
def foo ? bar < 0 ~= false
def foo ? bar >= 0 |= true
def foo ? bar < 0 |= false
*/

View File

@ -6,8 +6,8 @@ declaration scope A:
scope A:
def c = false
def a ? c ~= 42
def a ? not c ~= 0
def b ? not c ~= 1337
def b ? not c ~= 0
def a ? c |= 42
def a ? not c |= 0
def b ? not c |= 1337
def b ? not c |= 0
*/

View File

@ -22,5 +22,5 @@ scope A:
scope B:
def a = 42
def b = scopeA.b
def scopeA.a ? a > 0 ~= scopeA.a_base
def scopeA.a ? a > 0 |= scopeA.a_base
*/