pawn-lang / compiler

Pawn compiler for SA-MP with bug fixes and new features - runs on Windows, Linux, macOS
Other
307 stars 72 forks source link

Pawndoc truncated #698

Open Y-Less opened 2 years ago

Y-Less commented 2 years ago

Issue description:

I've not yet worked out exactly why this happens. I've briefly looked at the compiler source but haven't managed to analyse it enough yet. I've done loads of work with pawndoc comments and this is the first time I've seen this issue. For some reason this:

/**
 * <library>a_samp</library>
 * <summary>This function adds a 'static' pickup to the game. These pickups support weapons, health, armor etc., with the ability to function without scripting them (weapons/health/armor will be given automatically).</summary>
 * <param name="model">The model of the pickup</param>
 * <param name="type">The pickup type. Determines how the pickup responds when picked up</param>
 * <param name="x">The x coordinate to create the pickup at</param>
 * <param name="y">The y coordinate to create the pickup at</param>
 * <param name="z">The z coordinate to create the pickup at</param>
 * <param name="virtualWorld">The virtual world ID to put the pickup in. Use -1 to show the pickup in all worlds</param>
 * <returns>
 *   <b><c>1</c></b> if the pickup is successfully created.
 *   <br />
 *   <b><c>0</c></b> if failed to create.
 * </returns>
 * <remarks>This function doesn't return a pickup ID that you can use in, for example, <a href="#OnPlayerPickUpPickup">OnPlayerPickUpPickup</a>. Use <a href="#CreatePickup">CreatePickup</a> if you'd like to assign IDs.</remarks>
 * <seealso name="CreatePickup" />
 * <seealso name="DestroyPickup" />
 * <seealso name="OnPlayerPickUpPickup" />
 */
native AddStaticPickup(model, type, Float:x, Float:y, Float:z, virtualWorld = 0);

Gives the following XML output:

        <member name="M:AddStaticPickup" syntax="AddStaticPickup(model, type, x, y, z, virtualWorld)">
            <attribute name="native"/>
            <referrer name="CompileTest"/>
            <param name="model">
                The model of the pickup
            </param>
            <param name="type">
                The pickup type. Determines how the pickup responds when picked up
            </param>
            <param name="x">
                <paraminfo>Float </paraminfo>
                The x coordinate to create the pickup at
            </param>
            <param name="y">
                <paraminfo>Float </paraminfo>
                The y coordinate to create the pickup at
            </param>
            <param name="z">
                <paraminfo>Float </paraminfo>
                The z coordinate to create the pickup at
            </param>
            <param name="virtualWorld">
                The virtual world ID to put the pickup in. Use -1 to show the pickup in all  worlds
            </param>
            <library>a_samp</library>  <summary>This function adds a 'static' pickup to the game. These pickups support weapons, health, armor  etc., with the ability to function without scripting them (weapons/health/armor will be given automatically).</summary>              <returns>  <b><c>1</c></b> if the pickup is successfully created.  <br />  <b><c>0</c></b> if failed to create.  </returns>  <remarks>This function doesn't return a pickup ID that you can use in, for example, <a href="#OnPlayerPickUpPickup">OnPlayerPickUpPickup</a <seealso name="CreatePickup" />  <seealso name="DestroyPickup" />  <seealso name="OnPlayerPickUpPickup" /> 
        </member>

It's not very clear from all that, but the message gets cut off:

<remarks>This function doesn't return a pickup ID that you can use in, for example, <a href="#OnPlayerPickUpPickup">OnPlayerPickUpPickup</a>. Use <a href="#CreatePickup">CreatePickup</a> if you'd like to assign IDs.</remarks>

Becomes:

<remarks>This function doesn't return a pickup ID that you can use in, for example, <a href="#OnPlayerPickUpPickup">OnPlayerPickUpPickup</a

86 characters are missing. Why 86? I don't know.

Workspace Information:

Y-Less commented 2 years ago

MCVE:

#pragma rational Float

/**
 * <remarks>This function doesn't return a pickup ID that you can use in, for example, <a href="#OnPlayerPickUpPickup">OnPlayerPickUpPickup</a>. Use <a href="#CreatePickup">CreatePickup</a> if you'd like to assign IDs.</remarks>
 */
native AddStaticPickup(model, type, Float:x, Float:y, Float:z, virtualWorld = 0);

main()
{
    AddStaticPickup(0, 0, 0.0, 0.0, 0.0, 0);
}

Fix:

#pragma rational Float

/**
 * <remarks>This function doesn't return a pickup ID that you can use in, for example,
 * <a href="#OnPlayerPickUpPickup">OnPlayerPickUpPickup</a>.  Use
 * <a href="#CreatePickup">CreatePickup</a> if you'd like to assign IDs.</remarks>
 */
native AddStaticPickup(model, type, Float:x, Float:y, Float:z, virtualWorld = 0);

main()
{
    AddStaticPickup(0, 0, 0.0, 0.0, 0.0, 0);
}

So clearly the problem is line lengths, though the new compiler had them increased to 512.