mirror of
https://github.com/curl/curl
synced 2026-08-25 12:32:35 -04:00
fixup c-comments
This commit is contained in:
parent
a385dd06c3
commit
656e371fcd
1 changed files with 23 additions and 0 deletions
23
.github/scripts/c-comments
vendored
23
.github/scripts/c-comments
vendored
|
|
@ -20,6 +20,7 @@
|
|||
# 6 - #include line
|
||||
# 7 - backslash in a string
|
||||
# 8 - backslash in plain code
|
||||
# 9 - single quote in plain code
|
||||
#
|
||||
## Flags
|
||||
#
|
||||
|
|
@ -123,12 +124,34 @@ sub scanline {
|
|||
# switch back to plain code
|
||||
$state = 0;
|
||||
}
|
||||
elsif($state == 9) {
|
||||
# the prev was a single quote in code
|
||||
if($c eq "\n") {
|
||||
$line .= $c;
|
||||
# switch back to plain code
|
||||
$state = 0;
|
||||
}
|
||||
elsif($c eq "\\") {
|
||||
# a backslash followed the quote
|
||||
$line .= " ";
|
||||
$state = 8;
|
||||
}
|
||||
else {
|
||||
# switch back to plain code
|
||||
$state = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if($c eq "\\") {
|
||||
# got a backslash
|
||||
$line .= " ";
|
||||
$state = 8
|
||||
}
|
||||
elsif($c eq "\'") {
|
||||
# got a single quote
|
||||
$line .= " ";
|
||||
$state = 9
|
||||
}
|
||||
if($c eq "/") {
|
||||
$state = 1; # got a slash
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue