1
0

Add XON/XOFF parsing support & Fix OPTION

This commit is contained in:
otya128
2016-12-09 18:14:02 +09:00
parent 9feb911a95
commit 0306a215b0
2 changed files with 45 additions and 1 deletions

View File

@@ -864,8 +864,11 @@ class Parser
case TokenType.Iden:
{
wstring name = token.value.stringValue;
if (name == "OPTION")
auto uname = std.uni.toUpper(name);
if (uname == "OPTION")
{
lex.popFront;
token = lex.front;
if (token.type != TokenType.Iden)
{
syntaxError();
@@ -880,6 +883,24 @@ class Parser
lex.popFront();
return new Option(arg, lex.location);
}
if (uname == "XON" || uname == "XOFF")
{
lex.popFront;
token = lex.front;
if (token.type != TokenType.Iden)
{
syntaxError();
return null;
}
auto arg = std.uni.toUpper(token.value.stringValue);
if (arg != "MOTION" && arg != "EXPAD" && arg != "MIC" && arg != "WIIU")
{
syntaxError();
return null;
}
lex.popFront();
return uname == "XON" ? new XOn(arg, lex.location) : new XOff(arg, lex.location);
}
if (token.type != TokenType.Call)
{
auto old = lex.save;