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

Commit 5faf880

Browse files
author
livecodeali
committed
[[ Bug 17523 ]] Fix LCB property name parsing for docs
1 parent 984a9ca commit 5faf880

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

docs/notes/bugfix-17523.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Fix LCB docs builder handling of string-like property names

ide-support/revdocsparser.livecodescript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1523,7 +1523,7 @@ end revDocsParseHandler
15231523

15241524
on revDocsUpdateDocBlocksForProperty pData, pComment, @xDataA
15251525
local tName
1526-
put word 2 of pData into tName
1526+
put token 1 to -1 of word 2 of pData into tName
15271527
put pComment into xDataA[tName]["comments"]
15281528
put "property" into xDataA[tName]["type"]
15291529
put tName into xDataA[tName]["name"]

tests/lcs/docs/docsparser.livecodescript

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,31 @@ on TestBug16323
3838
put return & "Syntax: OnClose" after tDoc
3939
put return & "*/" after tDoc
4040
put return & "module com.livecode.widget" after tDoc
41+
put return & "end module" after tDoc
4142

4243
local tParsed
4344
put revDocsGenerateDocsFileFromText(tDoc, "") into tParsed
4445

4546
local tArray
46-
put revDocsParseDocTextToLibraryArray("", tVar, "", "") into tArray
47+
put revDocsParseDocTextToLibraryArray("", tParsed, "", "") into tArray
4748

4849
TestAssert "unwanted syntax element accumulation", tArray["doc"][2]["Syntax"][2] is empty
4950
end TestBug16323
51+
52+
on TestBug17523
53+
local tModule
54+
put "widget com.livecode.testdocs" into tModule
55+
put return & "/**" after tModule
56+
put return & "Summary: Test" after tModule
57+
put return & "*/" after tModule
58+
put return & "property" && quote & "testProp" & quote && "get mTest" after tModule
59+
put return & "end widget" after tModule
60+
61+
local tParsed
62+
put revDocsGenerateDocsFileFromText(tModule, "") into tParsed
63+
64+
local tArray
65+
put revDocsParseDocTextToLibraryArray("", tParsed, "", "") into tArray
66+
67+
TestAssert "property name has quotes stripped", tArray["doc"][1]["display name"] is "testProp"
68+
end TestBug17523

0 commit comments

Comments
 (0)