Skip to content

Commit

Permalink
Tweak Quote-syntax's handling of ^ character
Browse files Browse the repository at this point in the history
Bring it more in line with the handling of "normal" quotations.

Closes #1313
  • Loading branch information
mn200 committed Sep 30, 2024
1 parent 8397f82 commit b433fd5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
18 changes: 7 additions & 11 deletions tools/Holmake/QuoteFilter
Original file line number Diff line number Diff line change
Expand Up @@ -755,23 +755,19 @@ ProofLine =
);
<holstrlitlbrk> . => ((yypos, yytext));

<quote,tmquote,tyquote,defnquote,datatypequote>"^"+{ws} => ((yypos, (ECHO yyarg yytext)));
<quote,tmquote,tyquote,defnquote,datatypequote>"^"+{newline} => (
<quote,tmquote,tyquote,defnquote,datatypequote,rawquote>"^"+{ws} => ((yypos, (ECHO yyarg yytext)));
<quote,tmquote,tyquote,defnquote,datatypequote,rawquote>"^"+{newline} => (
(yypos,
if quotefix then yytext
else ECHO yyarg (String.substring(yytext,0,size yytext - 1) ^
qnewline yyarg (yypos,yytext)))
);
<rawquote>"^"+{ws} => (
<datatypequote,rawquote,defnquote>"^"+{newline}"End" => (
(yypos,
if quotefix then yytext
else ECHO yyarg (String.substring(yytext,1,size yytext - 1)))
);
<rawquote>"^"+{ws} => (
(yypos,
if quotefix then yytext
else ECHO yyarg (String.substring(yytext,1,size yytext - 2) ^
qnewline yyarg (yypos,yytext)))
(YYBEGIN INITIAL;
nextline yyarg (yypos + size yytext);
if quotefix then yytext
else String.substring(yytext,0,size yytext - 4) ^ "\"\n];"))
);
<quote,tmquote,tyquote,defnquote,datatypequote,rawquote>"^^" => (
(yypos, if quotefix then yytext else ECHO yyarg "^")
Expand Down
2 changes: 1 addition & 1 deletion tools/Holmake/tests/quote-filter/input
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,5 @@ Theorem thmname = expression

Quote bar_x:
another quotation (* with unfinished comment
and bare " with ^foo and ^^
and bare " with ^foo and ^
End

0 comments on commit b433fd5

Please sign in to comment.