Skip to content

Commit c3f013f

Browse files
authored
Merge pull request #166 from jahav/165-duplicated-valid-char
Don't require extra chars at the end of NameCombinationToken
2 parents e72584c + 5e0a01d commit c3f013f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/XLParser.Tests/ParserTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ public void TestNamedRangeCombination()
880880
{
881881
// See [Issue 46](https://github.com/spreadsheetlab/XLParser/issues/46)
882882
// This concerns names beginning with non-name words.
883-
var names = new[] {"A1ABC", "A1A1", "A2.PART_NUM", "A2?PART_NUM", "TRUEFOO", "FALSEFOO", "TRUEMODEL"};
883+
var names = new[] {"A1ABC", "A1A1", "A2.PART_NUM", "A2?PART_NUM", "TRUEFOO", "FALSEFOO", "TRUEMODEL", "W1."};
884884
foreach (var name in names)
885885
{
886886
Test(name, tree => tree.AllNodes(GrammarNames.NamedRange).Select(ExcelFormulaParser.Print).Contains(name));

src/XLParser/ExcelFormulaGrammar.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public class ExcelFormulaGrammar : Grammar
148148
;
149149

150150
// To prevent e.g. "A1A1" being parsed as 2 cell tokens
151-
public Terminal NamedRangeCombinationToken { get; } = new RegexBasedTerminal(GrammarNames.TokenNamedRangeCombination, NameInvalidWordsRegex + NameValidCharacterRegex + "+",
151+
public Terminal NamedRangeCombinationToken { get; } = new RegexBasedTerminal(GrammarNames.TokenNamedRangeCombination, NameInvalidWordsRegex,
152152
ColumnPrefix.Concat(new[] { "T", "F" }).ToArray())
153153
{ Priority = TerminalPriority.NamedRangeCombination };
154154

0 commit comments

Comments
 (0)