Created
February 6, 2021 14:30
-
-
Save korzio/10413d8a7ccf739e09545fbc784898f5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Filter(func(i interface{}) bool { | |
tok := i.(interState) | |
return tok.Return != "" | |
}). | |
Map(func(_ context.Context, i interface{}) (interface{}, error) { | |
var tok token.Token | |
tok.Literal = i.(interState).Return | |
tok.Type = token.INT | |
if isOperator(tok.Literal) { | |
tok.Type = token.TokenType(tok.Literal) | |
} | |
return tok, nil | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment