forked from aspnet/AspNetWebStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCSharpSymbol.cs
More file actions
48 lines (40 loc) · 1.67 KB
/
Copy pathCSharpSymbol.cs
File metadata and controls
48 lines (40 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Generic;
using System.Linq;
using System.Web.Razor.Parser.SyntaxTree;
using System.Web.Razor.Text;
namespace System.Web.Razor.Tokenizer.Symbols
{
public class CSharpSymbol : SymbolBase<CSharpSymbolType>
{
// Helper constructor
public CSharpSymbol(int offset, int line, int column, string content, CSharpSymbolType type)
: this(new SourceLocation(offset, line, column), content, type, Enumerable.Empty<RazorError>())
{
}
public CSharpSymbol(SourceLocation start, string content, CSharpSymbolType type)
: this(start, content, type, Enumerable.Empty<RazorError>())
{
}
public CSharpSymbol(int offset, int line, int column, string content, CSharpSymbolType type, IEnumerable<RazorError> errors)
: base(new SourceLocation(offset, line, column), content, type, errors)
{
}
public CSharpSymbol(SourceLocation start, string content, CSharpSymbolType type, IEnumerable<RazorError> errors)
: base(start, content, type, errors)
{
}
public bool? EscapedIdentifier { get; set; }
public CSharpKeyword? Keyword { get; set; }
public override bool Equals(object obj)
{
CSharpSymbol other = obj as CSharpSymbol;
return base.Equals(obj) && other.Keyword == Keyword;
}
public override int GetHashCode()
{
return base.GetHashCode() ^ Keyword.GetHashCode();
}
}
}