![]() |
Telelogic SYNERGY (steve huntington) | ![]() |
Topic Title: mask %-signs in keyword expansion Topic Summary: Created On: 18-May-2007 13:45 Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
Hi there,
i try to find a way to mask percent signs while Synergy/CM is doing keyword expansion. I have a html object, which has many such signs (widht=xxx%; ...) but also keywords. Is there a way to mask this %-signs? I already tried different methods like %%, \% or '%' but nothing seems to work. Any hint is appreciated. regards, Sven |
|
![]() |
|
![]() |
|
Hi Sven,
I had a similar problem with Java source that contained string literals using %keywords. The thing to watch out for are strings of the form "%keyword: ([^%]*)%. Note the ':' after the keyword. Without that colon, the keyword expansion is only done once, usually from the source file template when the object is created. But with the "%keyword: %" form, the keyword is reexpanded on every check out and check in. The way I solved my issue was to split the string. For example instead of: "%cvtype:%subsystem" I used: "%cvtype" + ":%subsystem" so that the second part was on the next line. The keyword expansion deals with lines and won't look for the closing "%" across lines. Usually with HTML, the text is whitespace insensitive. So you may be able to break the lines so that any colon after "%name" appears on the next line rather than the following one. Another idea is to use a different way of expressing the colon character such as using a character entity in HTML, or a character reference in XML. Another solution is to define or use a separate type for which keyword expansion is disabled and then use that type for your problematic HTML files. However, that would mean that you could not use keywords in comments at the start of the file and have them expanded. Lastly, there is the range_for_keyword_expand option that can be set so that it only looks at the first N characters. The problem with this is that each user can set a different value as a personal preference and this applies to all types for which expansion is performed on behalf of that user. In the case of source code files where you want to use keywords in long comment headers, N might have to be larger than the default. Hope this helps, David. |
|
![]() |
Telelogic SYNERGY
» SYNERGY/CM
»
mask %-signs in keyword expansion
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.