add: Array declaration and variable indexer.
This commit is contained in:
@@ -131,6 +131,21 @@ public class LexicalParserTests : LexicalTestBase
|
||||
]);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void LexicalParserTest4()
|
||||
{
|
||||
ValidateLexicalTokens(LexicalScanner.PascalParser(), "array [0..9] of integer", [
|
||||
(LexicalTokenType.Keyword, "array"),
|
||||
(LexicalTokenType.Delimiter, "["),
|
||||
(LexicalTokenType.ConstInteger, "0"),
|
||||
(LexicalTokenType.Delimiter, ".."),
|
||||
(LexicalTokenType.ConstInteger, "9"),
|
||||
(LexicalTokenType.Delimiter, "]"),
|
||||
(LexicalTokenType.Keyword, "of"),
|
||||
(LexicalTokenType.Keyword, "integer")
|
||||
]);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("""
|
||||
program exFunction;
|
||||
|
||||
@@ -107,6 +107,7 @@ public class LexicalTokenParserTest : LexicalTestBase
|
||||
[Theory]
|
||||
[InlineData(123, "123")]
|
||||
[InlineData(0, "0")]
|
||||
[InlineData(10, "10..20")]
|
||||
public void ConstIntegerTest(int value, string input)
|
||||
{
|
||||
StringReadState state = new(input);
|
||||
|
||||
Reference in New Issue
Block a user