Skip to content

Commit a3b0a4a

Browse files
committed
Fix typos
1 parent 19e9948 commit a3b0a4a

7 files changed

Lines changed: 22 additions & 21 deletions

File tree

OpenLanguage/WordprocessingML/FieldInstruction/FieldInstruction.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1572,9 +1572,9 @@ public FieldArgument(FieldArgumentType type, object? value)
15721572
}
15731573

15741574
/// <summary>
1575-
/// Recompiles the argument back into its valid field code string representation.
1575+
/// Recompiles the argument back into its valid field instruction string representation.
15761576
/// </summary>
1577-
/// <returns>A string representing the argument as it would appear in a field code.</returns>
1577+
/// <returns>A string representing the argument as it would appear in a field instruction.</returns>
15781578
public override string ToString()
15791579
{
15801580
switch (Type)
@@ -1603,7 +1603,7 @@ public override string ToString()
16031603
/// <summary>
16041604
/// Represents a fully parsed Word field instruction, including its main
16051605
/// instruction keyword (e.g., "MERGEFIELD") and a list of its arguments.
1606-
/// This object can be modified and recompiled back into a field code string.
1606+
/// This object can be modified and recompiled back into a field instruction string.
16071607
/// </summary>
16081608
public class FieldInstruction
16091609
{
@@ -1640,9 +1640,9 @@ public FieldInstruction(string instruction, List<FieldArgument> arguments)
16401640

16411641
/// <summary>
16421642
/// Recompiles the entire FieldInstruction object back into a valid,
1643-
/// standards-compliant field code string.
1643+
/// standards-compliant field instruction string.
16441644
/// </summary>
1645-
/// <returns>The reconstructed field code string.</returns>
1645+
/// <returns>The reconstructed field instruction string.</returns>
16461646
public override string ToString()
16471647
{
16481648
StringBuilder sb = new StringBuilder();

OpenLanguage/WordprocessingML/FieldInstruction/Lexer.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
namespace OpenLanguage.WordprocessingML.FieldInstruction
99
{
1010
/// <summary>
11-
/// Defines the types of tokens that can be found in a Word field code.
11+
/// Defines the types of tokens that can be found in a Word field instruction.
1212
/// </summary>
1313
public enum FieldTokenType
1414
{
@@ -24,7 +24,7 @@ public enum FieldTokenType
2424
}
2525

2626
/// <summary>
27-
/// Represents a token extracted from a field code string by the lexer.
27+
/// Represents a token extracted from a field instruction string by the lexer.
2828
/// </summary>
2929
public class FieldToken
3030
{
@@ -43,7 +43,7 @@ public FieldToken(FieldTokenType type, string value, int startIndex)
4343
}
4444

4545
/// <summary>
46-
/// A lexer for tokenizing Word field codes into a stream of tokens.
46+
/// A lexer for tokenizing Word field instructions into a stream of tokens.
4747
/// </summary>
4848
public static class FieldLexer
4949
{

OpenLanguage/WordprocessingML/FieldInstruction/Parser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public FieldInstruction Parse(string fieldCode)
7676
return null;
7777
}
7878

79-
// A valid field code might start with a brace, or just the instruction for simple cases.
79+
// A valid field instruction might start with a brace, or just the instruction for simple cases.
8080
if (firstToken.Type == FieldTokenType.LeftBrace)
8181
{
8282
return TryParseInstruction(tokenEnumerable.ToList());

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ OpenLanguage is a C# library providing lexers, parsers, and other processing too
1010

1111
### WordprocessingML
1212

13-
- **Field Instructions**: Parse Word field codes into structured objects with arguments
13+
- **Field Instructions**: Parse Word field instructions into structured objects with arguments
1414
- **Typed Field Instructions**: Factory pattern for converting generic instructions to strongly-typed objects
1515
- **Comprehensive Field Types**: Support for 70+ Word field instruction types (REF, MERGEFIELD, IF, etc.) - intended to be comprehensive
1616
- **Argument Handling**: Process identifiers, string literals, switches, and nested fields
17-
- **Field Reconstruction**: Convert parsed instructions back to valid field code strings
17+
- **Field Reconstruction**: Convert parsed instructions back to valid field instruction strings
1818

1919
### SpreadsheetML
2020

@@ -73,8 +73,8 @@ instruction.Arguments.Add(new FieldArgument(FieldArgumentType.Switch, "\* Upper"
7373
// Convert to strongly-typed (if available)
7474
var typedInstruction = TypedFieldInstructionFactory.Create(instruction);
7575

76-
// Reconstruct field code
77-
Console.WriteLine($"Field Code: {instruction.ToString()}");
76+
// Reconstruct field instruction
77+
Console.WriteLine($"Field instruction: {instruction.ToString()}");
7878
```
7979

8080
## Building from Source

docs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ OpenLanguage consists of:
4747
- Lang/Lex/formula.lex: Lexical grammar for SpreadsheetML formulas
4848
- Lang/Parse/formula.y: YACC grammar for SpreadsheetML formulas
4949
- **WordprocessingML.FieldInstruction**: WordprocessingML field instruction parser
50+
5051
- FieldInstruction.cs: Core field instruction and argument classes
5152
- Typed/: Factory and base classes for strongly-typed instructions
5253
- Parser.cs & Lexer.cs: Parser components

docs/api/WordprocessingML/FieldInstruction/FieldInstruction.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This component provides:
88

99
- **Field Instruction Creation**: Build field instructions programmatically
1010
- **Argument Handling**: Support for different argument types (identifiers, strings, switches, nested fields)
11-
- **Field Reconstruction**: Convert field objects back to field code strings
11+
- **Field Reconstruction**: Convert field objects back to field instruction strings
1212
- **Type Safety**: Strongly-typed field instruction factory
1313

1414
## Core Classes
@@ -25,15 +25,15 @@ var instruction = new FieldInstruction("MERGEFIELD");
2525
instruction.Arguments.Add(new FieldArgument(FieldArgumentType.Identifier, "FirstName"));
2626
instruction.Arguments.Add(new FieldArgument(FieldArgumentType.Switch, "\* Upper"));
2727

28-
// Reconstruct field code
28+
// Reconstruct field instruction
2929
Console.WriteLine(instruction.ToString()); // "MERGEFIELD FirstName \* Upper"
3030
```
3131

3232
#### Properties and Methods
3333

3434
- `string Instruction` - The field keyword (e.g., "MERGEFIELD", "REF", "IF")
3535
- `List<FieldArgument> Arguments` - List of field arguments that can be modified
36-
- `ToString()` - Reconstructs the field code string
36+
- `ToString()` - Reconstructs the field instruction string
3737

3838
### FieldArgument
3939

@@ -45,7 +45,7 @@ public class FieldArgument
4545
public FieldArgumentType Type { get; } // Type of argument
4646
public object Value { get; } // Argument value
4747
48-
public override string ToString() // Reconstructs argument as field code
48+
public override string ToString() // Reconstructs argument as field instruction
4949
}
5050
```
5151

@@ -405,7 +405,7 @@ if (typedHyperlink != null)
405405

406406
### Field Instruction Parsing from Text
407407

408-
The library provides robust parsing capabilities for field codes:
408+
The library provides robust parsing capabilities for field instructions:
409409

410410
```csharp
411411
// Parse complex nested fields
@@ -649,7 +649,7 @@ public class FieldInstructionSerializer
649649

650650
- Field instructions are mutable objects that can be modified after creation
651651
- Arguments list can be manipulated directly (add, remove, modify)
652-
- ToString() method reconstructs valid field code syntax
652+
- ToString() method reconstructs valid field instruction syntax
653653
- All string values are properly escaped when reconstructed
654654
- Nested fields are formatted with proper brace spacing
655655
- The component includes comprehensive enumerations for Word-specific values

docs/examples/field-instruction.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Field Instruction Examples
22

3-
This document demonstrates how to use the OpenLanguage WordprocessingML FieldInstruction parser to parse and manipulate Microsoft Word field codes.
3+
This document demonstrates how to use the OpenLanguage WordprocessingML FieldInstruction parser to parse and manipulate Microsoft Word field instructions.
44

55
## Basic Usage
66

@@ -394,4 +394,4 @@ foreach (string fieldCode in invalidFields)
394394
}
395395
```
396396

397-
This comprehensive example demonstrates the core functionality of the OpenLanguage FieldInstruction parser, showing how to parse, manipulate, and reconstruct Microsoft Word field codes.
397+
This comprehensive example demonstrates the core functionality of the OpenLanguage FieldInstruction parser, showing how to parse, manipulate, and reconstruct Microsoft Word field instructions.

0 commit comments

Comments
 (0)