mirror of
https://github.com/Cekis/SWG-ScriptConverter.git
synced 2026-01-16 22:04:29 -05:00
24 lines
645 B
C#
24 lines
645 B
C#
using ScriptConverter.Ast;
|
|
using ScriptConverter.Ast.Declarations;
|
|
|
|
namespace ScriptConverter.Parser.Parselets.Declarations
|
|
{
|
|
class PublicParselet : IDeclarationParselet
|
|
{
|
|
public Declaration Parse(ScriptParser parser, ScriptToken token)
|
|
{
|
|
ScriptType type;
|
|
string name;
|
|
parser.ParseNamedType(out type, out name);
|
|
|
|
parser.Take(ScriptTokenType.Assign);
|
|
|
|
var value = parser.ParseExpression();
|
|
|
|
parser.Take(ScriptTokenType.Semicolon);
|
|
|
|
return new FieldDeclaration(token, parser.Previous, type, name, value, false, true);
|
|
}
|
|
}
|
|
}
|