From 955e2622f2b069f12334c48af17f06a058f7c7b4 Mon Sep 17 00:00:00 2001 From: Timothy Clem Date: Tue, 10 Dec 2019 13:09:46 -0800 Subject: [PATCH] Few more python built-in functions --- semantic-python/src/Language/Python/Tags.hs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/semantic-python/src/Language/Python/Tags.hs b/semantic-python/src/Language/Python/Tags.hs index 6832d0212..a42d6b4ee 100644 --- a/semantic-python/src/Language/Python/Tags.hs +++ b/semantic-python/src/Language/Python/Tags.hs @@ -51,8 +51,11 @@ type family ToTagsInstance t :: Strategy where -- These built-in functions all get handled as calls ToTagsInstance Py.AssertStatement = 'Custom - ToTagsInstance Py.GlobalStatement = 'Custom + ToTagsInstance Py.Await = 'Custom ToTagsInstance Py.DeleteStatement = 'Custom + ToTagsInstance Py.ExecStatement = 'Custom + ToTagsInstance Py.GlobalStatement = 'Custom + ToTagsInstance Py.NonlocalStatement = 'Custom ToTagsInstance Py.PrintStatement = 'Custom ToTagsInstance _ = 'Generic @@ -71,12 +74,21 @@ keywordFunctionCall t loc range name = do instance ToTagsBy 'Custom Py.AssertStatement where tags' t@Py.AssertStatement { ann = loc@Loc { byteRange = range } } = keywordFunctionCall t loc range "assert" +instance ToTagsBy 'Custom Py.Await where + tags' t@Py.Await { ann = loc@Loc { byteRange = range } } = keywordFunctionCall t loc range "await" + instance ToTagsBy 'Custom Py.DeleteStatement where tags' t@Py.DeleteStatement { ann = loc@Loc { byteRange = range } } = keywordFunctionCall t loc range "del" +instance ToTagsBy 'Custom Py.ExecStatement where + tags' t@Py.ExecStatement { ann = loc@Loc { byteRange = range } } = keywordFunctionCall t loc range "exec" + instance ToTagsBy 'Custom Py.GlobalStatement where tags' t@Py.GlobalStatement { ann = loc@Loc { byteRange = range } } = keywordFunctionCall t loc range "global" +instance ToTagsBy 'Custom Py.NonlocalStatement where + tags' t@Py.NonlocalStatement { ann = loc@Loc { byteRange = range } } = keywordFunctionCall t loc range "nonlocal" + instance ToTagsBy 'Custom Py.PrintStatement where tags' t@Py.PrintStatement { ann = loc@Loc { byteRange = range } } = keywordFunctionCall t loc range "print"