diff options
author | Rustan Leino <leino@microsoft.com> | 2011-08-03 00:08:33 -0700 |
---|---|---|
committer | Rustan Leino <leino@microsoft.com> | 2011-08-03 00:08:33 -0700 |
commit | fb76504a943c1fa76c7aceec9dc81de4c35f08c8 (patch) | |
tree | bc976c2c954275afbd34ea0247da7a32587d9d98 /Util/VS2010 | |
parent | eaa62a170a1b77515cd99b828abd4794eed5f9d4 (diff) |
Chalice VS integration: recognize string literals
Diffstat (limited to 'Util/VS2010')
-rw-r--r-- | Util/VS2010/Chalice/ChaliceLanguageService/Grammar.cs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Util/VS2010/Chalice/ChaliceLanguageService/Grammar.cs b/Util/VS2010/Chalice/ChaliceLanguageService/Grammar.cs index 4ae603e8..8a05d7b2 100644 --- a/Util/VS2010/Chalice/ChaliceLanguageService/Grammar.cs +++ b/Util/VS2010/Chalice/ChaliceLanguageService/Grammar.cs @@ -10,7 +10,8 @@ namespace Demo {
public Grammar() {
#region 1. Terminals
- NumberLiteral n = TerminalFactory.CreateCSharpNumber("number");
+ NumberLiteral n = TerminalFactory.CreateCSharpNumber("number");
+ StringLiteral s = new StringLiteral("String", "\"", StringFlags.AllowsAllEscapes);
IdentifierTerminal ident = new IdentifierTerminal("Identifier");
// Copy pasted directly from Parser.scala
@@ -51,7 +52,6 @@ namespace Demo #region Disabled for a simpler grammar
/*
- StringLiteral s = new StringLiteral("String", "'", StringFlags.AllowsDoubledQuote);
Terminal dot = ToTerm(".", "dot");
Terminal less = ToTerm("<");
Terminal greater = ToTerm(">");
@@ -384,7 +384,7 @@ namespace Demo NonTerminal Simple = new NonTerminal("SimpleProg");
NonTerminal Anything = new NonTerminal("Token");
Simple.Rule = Anything.Star() + Eof;
- Anything.Rule = n;
+ Anything.Rule = n | s;
foreach (string keyword in reserved) Anything.Rule = Anything.Rule | ToTerm(keyword);
Anything.Rule = Anything.Rule | ident;
foreach (string delimiter in delimiters) Anything.Rule = Anything.Rule | ToTerm(delimiter);
|