Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 3b3e54a

Browse files
authored
Merge pull request #5683 from bwmilby/bugfix-19622
[[ Bug 19622 ]] Line continuations
2 parents ff185d6 + 1fe0396 commit 3b3e54a

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

ide-support/revdocsparser.livecodescript

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ on revDocsExtractDocBlocks pText, pSource, @rAPIData, @rLibraryData
452452
put false into tInComment
453453
put false into tInEntry
454454

455-
local tFirstWord, tEntryData
455+
local tFirstWord, tEntryData, tTrimLine
456456
local tComment, tData
457457
local tHandlerData, tPhraseData
458458

@@ -614,14 +614,23 @@ on revDocsExtractDocBlocks pText, pSource, @rAPIData, @rLibraryData
614614
end if
615615

616616
# If we are in an entry, add the line to the current data
617-
if tInEntry then
617+
if tInEntry then
618+
# handle line continuations
619+
if char -2 of tData is "\" then
620+
delete char -2 to -1 of tData
618621
# ignore empty lines
619-
if tFirstWord is empty then
622+
else if tFirstWord is empty then
620623
next repeat
621624
else if tFirstWord is "end" then
622625
put true into tEntryEnded
623626
end if
624-
put tLine & return after tData
627+
# continuation character can have spaces afterwards [[Bug 19927]]
628+
# trim trailing spaces before adding
629+
if matchText(tLine, "^(.*\\)\s*$", tTrimLine) then
630+
put tTrimLine & return after tData
631+
else
632+
put tLine & return after tData
633+
end if
625634
end if
626635

627636
# If the entry is ended, convert all the collected data to a structured array

0 commit comments

Comments
 (0)