-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix lexer rule to handle operator of format like
operator + comment
- Loading branch information
Showing
3 changed files
with
81 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
default Order dec | ||
$include <prelude.sail> | ||
|
||
infix 4 ===_u | ||
infix 4 =/ | ||
infix 4 ===/_u | ||
infix 4 /=/=/=_u | ||
infix 4 ===*_u | ||
|
||
val operator ===/_u : forall 'n. (int('n), int('n)) -> bool | ||
function operator ===/_u(x, y) = x == y | ||
|
||
val operator =/ : forall 'n. (int('n), int('n)) -> bool | ||
function operator =/(x, y) = x == y | ||
|
||
function f () = { | ||
if eq2_comment == /**/ /**/ 1 then { | ||
1 | ||
}; | ||
|
||
if eq_slash =/ 1 then { | ||
1 | ||
}; | ||
|
||
let eq_comment = | ||
/**/ 1; | ||
let eq_comment = | ||
// | ||
1; | ||
|
||
if eq3_slash ===/_u 1 then { | ||
1 | ||
}; | ||
|
||
0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
default Order dec | ||
$include <prelude.sail> | ||
|
||
infix 4 ===_u | ||
infix 4 =/ | ||
infix 4 ===/_u | ||
infix 4 /=/=/=_u | ||
infix 4 ===*_u | ||
|
||
val operator ===/_u : forall 'n. (int('n), int('n)) -> bool | ||
function operator ===/_u(x, y) = x == y | ||
|
||
val operator =/ : forall 'n. (int('n), int('n)) -> bool | ||
function operator =/(x, y) = x == y | ||
|
||
function f () = { | ||
if eq2_comment /**/==/**/ 1 then { 1 }; | ||
|
||
if eq_slash =/ 1 then { 1 }; | ||
|
||
let eq_comment =/**/ 1; | ||
let eq_comment =// | ||
1; | ||
|
||
if eq3_slash ===/_u 1 then { 1 }; | ||
|
||
0 | ||
} |