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

Commit fc1186e

Browse files
committed
[[ Bug 16323 ]] Make sure syntax variable is reset for each docs element
1 parent 7966c35 commit fc1186e

File tree

3 files changed

+48
-2
lines changed

3 files changed

+48
-2
lines changed

docs/notes/bugfix-16323.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Syntax is not being cleared between docs 'message' entries

ide-support/revdocsparser.livecodescript

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -765,6 +765,7 @@ function revDocsFormatInlineComments pDataA, pIsLibrary
765765
repeat with x = tStart to tEnd
766766
put empty into tHasA
767767
put empty into tEntryDoc
768+
put empty into tSyntax
768769
put tEntriesA[x] into tEntryA
769770
repeat with y = 1 to the number of elements in tEntryA["elements"]
770771
put tEntryA["elements"][y] into tElementA
@@ -858,8 +859,8 @@ function revDocsFormatInlineComments pDataA, pIsLibrary
858859
if tHasA["Syntax"] is not true then
859860
put pDataA["syntax"] into tSyntax
860861
end if
861-
repeat with x = 1 to the number of elements in tSyntax
862-
put "Syntax:" && tSyntax[x] & return & return before tEntryDoc
862+
repeat with z = 1 to the number of elements in tSyntax
863+
put "Syntax:" && tSyntax[z] & return & return before tEntryDoc
863864
end repeat
864865

865866
if tHasA["Type"] is not true then
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
script "DocsParser"
2+
/*
3+
Copyright (C) 2015 LiveCode Ltd.
4+
5+
This file is part of LiveCode.
6+
7+
LiveCode is free software; you can redistribute it and/or modify it under
8+
the terms of the GNU General Public License v3 as published by the Free
9+
Software Foundation.
10+
11+
LiveCode is distributed in the hope that it will be useful, but WITHOUT ANY
12+
WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+
for more details.
15+
16+
You should have received a copy of the GNU General Public License
17+
along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
18+
19+
on TestSetup
20+
local tDocsParser
21+
put TestGetEngineRepositoryPath() & "/ide-support/revdocsparser.livecodescript" into tDocsParser
22+
start using stack tDocsParser
23+
end TestSetup
24+
25+
on TestBug16323
26+
local tDoc
27+
put "/*" into tDoc
28+
put return & "Name: OnOpen" after tDoc
29+
put return & "Type: message" after tDoc
30+
put return & "Syntax: OnOpen" after tDoc
31+
put return & "Name: OnClose" after tDoc
32+
put return & "Type: message" after tDoc
33+
put return & "Syntax: OnClose" after tDoc
34+
put return & "*/" after tDoc
35+
put return & "module com.livecode.widget" after tDoc
36+
37+
local tParsed
38+
put revDocsGenerateDocsFileFromText(tDoc, "") into tParsed
39+
40+
local tArray
41+
put revDocsParseDocTextToLibraryArray("", tVar, "", "") into tArray
42+
43+
TestAssert "unwanted syntax element accumulation", tArray["doc"][2]["Syntax"][2] is empty
44+
end TestBug16323

0 commit comments

Comments
 (0)