You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sauclovian-g opened this issue
Jan 20, 2025
· 0 comments
Assignees
Labels
tech debtIssues that document or involve technical debttype: bugIssues reporting bugs or unexpected/unwanted behaviorusabilityAn issue that impedes efficient understanding and use
The saw-script lexer treats Cryptol blocks (both terms and types) as lexemes and doesn't look inside them at all. This means comments in Cryptol blocks are handled by Cryptol's lexer downstream, and that has some odd consequences:
Comments that start in Cryptol blocks end at the end of the Cryptol block.
sawscript> let x = {{ /* 3 }} */
Parse error at <stdin>:1:20-1:22: Unexpected `*/'
and
sawscript> let x = ( {{ 1 // one }}, 2)
sawscript> return x
[21:06:41.173] (\(u1217 : isort 0) ->
\(_P : PLiteral u1217) -> ecNumber (TCNum 1) u1217 _P,2)
(the }} and after is not commented out)
Comments that appear to end in Cryptol blocks actually don't, because the Cryptol block is recognized even inside a comment:
sawscript> let x = /* {{ 1 */ 2 }}
<stdin>:1:9-1:11: Unclosed block comment
Parse error at <stdin>:2:1-2:1: Unexpected `EOF'
and
let x = // {{ 3
}};
"abc";
which succeeds leaves x bound to "abc".
All this is not entirely desirable, and the last behavior is definitely confusing. On the minus side it's not clear that this is fixable without rewriting the lexer with an entirely different approach.
The text was updated successfully, but these errors were encountered:
(interactions of comments and Cryptol blocks)
Note: these reflect the current behavior, which as discussed in the
issue is not particularly desirable. They should be updated when/if
the behavior is improved.
tech debtIssues that document or involve technical debttype: bugIssues reporting bugs or unexpected/unwanted behaviorusabilityAn issue that impedes efficient understanding and use
The saw-script lexer treats Cryptol blocks (both terms and types) as lexemes and doesn't look inside them at all. This means comments in Cryptol blocks are handled by Cryptol's lexer downstream, and that has some odd consequences:
and
(the
}}
and after is not commented out)and
which succeeds leaves
x
bound to"abc"
.All this is not entirely desirable, and the last behavior is definitely confusing. On the minus side it's not clear that this is fixable without rewriting the lexer with an entirely different approach.
The text was updated successfully, but these errors were encountered: