Skip to content

Docs: align statement syntax topics with XSharp.g4 parser - #2095

Merged
RobertvanderHulst merged 11 commits into
devfrom
copilot/update-docs-to-match-parser
Oct 1, 2026
Merged

RobertvanderHulst merged 11 commits into
devfrom
copilot/update-docs-to-match-parser

Conversation

Copilot AI commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Updates syntax sections in docs/Help/Topics to match the parser grammar (XSharp.g4).

Changed topics: BEGIN CHECKED (END UNCHECKED), FOR, FOREACH, WITH, BEGIN USING, ENUM, DELEGATE, RETURN, NOP, DO WHILE, IF (optional keywords, alternative terminators such as ENDFOR/ENDIF/ENDDO/ENDWITH, AWAIT, AS/INHERIT, IMPLIED, calling convention, RETURN VOID, NOP()).

Docs-only change; xBase command topics (preprocessor-defined) were not compared.

@RobertvanderHulst
RobertvanderHulst changed the base branch from main to dev October 1, 2026 09:15
@RobertvanderHulst
RobertvanderHulst marked this pull request as ready for review October 1, 2026 09:15
Copilot AI balanced review requested due to automatic review settings October 1, 2026 09:15
@RobertvanderHulst
RobertvanderHulst merged commit ae0ed9f into dev Oct 1, 2026
6 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The unrelated runtime change introduces a setter-resolution regression, and several updated syntax topics remain incomplete or ambiguous.

Review effort: Balanced
Findings: 1 High severity · 1 Medium severity · 3 Low severity

Open (5)
What changed in this PR

Aligns statement syntax documentation with the XSharp parser, but also includes an unrelated runtime behavior change.

Changes:

  • Documents optional keywords, terminators, and syntax alternatives.
  • Corrects the END UNCHECKED example.
  • Adds dynamic-property handling to runtime field resolution.
File Description
src/​Runtime/​XSharp.RT/​Functions/​CompilerSupport.prg Changes field-resolution behavior.
docs/​Help/​Topics/​command_WITH.xml Updates type and terminator syntax.
docs/​Help/​Topics/​command_RETURN.xml Documents RETURN VOID.
docs/​Help/​Topics/​command_NOP.xml Documents optional parentheses.
docs/​Help/​Topics/​command_IF.xml Documents alternative terminators.
docs/​Help/​Topics/​command_FOREACH.xml Adds AWAIT, declarations, and ENDFOR.
docs/​Help/​Topics/​command_FOR.xml Updates declaration and terminator forms.
docs/​Help/​Topics/​command_ENUM.xml Adds INHERIT, attributes, and MEMBER.
docs/​Help/​Topics/​command_DO_WHILE.xml Documents supported terminators.
docs/​Help/​Topics/​command_DELEGATE.xml Adds calling-convention syntax.
docs/​Help/​Topics/​command_BEGIN-USING.xml Adds AWAIT and optional terminator syntax.
docs/​Help/​Topics/​command_BEGIN-CHECKED.xml Corrects the unchecked terminator.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +276 to +280
err := Error{EG_NOVAR, nameof(fldName), ErrString(EG_NOVAR) + ": " + fldName}
err:FuncSym := __function__
err:ArgNum := 2
err:Args := <OBJECT>{wa, fldName}
THROW err
Comment on lines +118 to +119
LOCAL nArea := VoDbGetSelect(wa) AS DWORD
LOCAL err := NULL as Error
<para styleclass="Normal"></para>
<para styleclass="Heading1">Syntax</para>
<para styleclass="Code with box">BEGIN USING <text style="font-style:italic;">declaration</text><br/> &#160; <text style="font-style:italic;">statements</text><br/>END USING</para>
<para styleclass="Code with box">BEGIN USING [AWAIT] <text style="font-style:italic;">declaration</text><br/> &#160; <text style="font-style:italic;">statements</text><br/>END [USING]</para>
<para styleclass="Normal"><tab />[([&lt;<text styleclass="Italic">idParam</text>&gt; [AS | REF|OUT|IN &lt;<text styleclass="Italic">idType</text>&gt;] [, ...])] </para>
<para styleclass="Normal"><tab />[AS &lt;<text styleclass="Italic">idType</text>&gt;]</para>
<para styleclass="Normal"><tab />[TypeparameterConstraints]</para>
<para styleclass="Normal"><tab />[&lt;<text styleclass="Italic">idConvention</text>&gt;]</para>
<para styleclass="Normal"><tab />[attributes] [Modifiers] </para>
<para styleclass="Normal"><tab />ENUM &lt;idEnumName&gt; [AS type] &#160; </para>
<para styleclass="Normal"><tab /><tab />memberName [:= value]</para>
<para styleclass="Normal"><tab />ENUM &lt;idEnumName&gt; [AS | INHERIT type] &#160; </para>
@RobertvanderHulst
RobertvanderHulst deleted the copilot/update-docs-to-match-parser branch October 1, 2026 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants