-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Method definitions #28
Labels
bug
Something isn't working
Comments
So, narrowing it down best I can at the moment... It seems to be an issue with the Parser not accepting '::' after a defined type It returns a syntax error |
So... I have a hacky work around... Changing in ParserInput private int[] retTypes = { 296, 297, 298, 299, 302, 303, 306, 307, 285 };
private bool IsReturnType(Token tok)
{
for (int i = 0; i < retTypes.Length; i++)
{
if (tok.Kind == retTypes[i])
return true;
}
return false;
}
public Token CurrentToken
{
get
{
if(Tokens[index].Kind == TokenKind.IDENTIFIER && typedefs.Contains(Tokens[index].StringValue))
{
if(index > 0 && index + 1 < Tokens.Length)
{
if (Tokens[index+1].Kind == TokenKind.COLONCOLON && IsReturnType(Tokens[index - 1]))
{
return Tokens[index];
}
}else
{
return Tokens[index].AsKind(TokenKind.TYPE_NAME);
}
return Tokens[index].AsKind(TokenKind.TYPE_NAME);
} else
return Tokens[index];
}
} |
Oh nasty bug :-( I'm working on improving this parsing support. Your hack is amazing but I think I can improve the grammar. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When declaring a struct or class, it seems to only be possible to declare functions such as void Test::TestFunc(){ } using the addinternalfunction method. It does not seem to work in code?
The text was updated successfully, but these errors were encountered: