git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Add array indexing support
commit148f0447fb27dfc9999c23ef4406f9f374bce067 authorAndy Arvanitis <andyarvanitis@gmail.com> dateSun 7 Jul 2019, 19:27 (7 years ago) parented1aafe
1 file changed+7
src/CodeGen/IL/Printer.hs+7
src/CodeGen/IL/Printer.hs+7
@@ -175,6 +175,13 @@ literals = mkPattern' match'
175175 , prettyPrintIL' (Var Nothing $ withPrefix name)
176176 , return $ emit "()"
177177 ]
178+ match (Indexer _ index@NumericLiteral{} val) = mconcat <$> sequence
179+ [ return $ emit "At("
180+ , prettyPrintIL' val
181+ , return $ emit ", "
182+ , prettyPrintIL' index
183+ , return $ emit ")"
184+ ]
178185 match (Indexer _ prop val) = mconcat <$> sequence
179186 [ return $ emit "Get("
180187 , prettyPrintIL' val