mirror of
https://github.com/github/semantic.git
synced 2024-11-27 12:57:49 +03:00
Define the Python prelude using our primitive DSL.
This commit is contained in:
parent
4c4c8db3f8
commit
5bcc6271ec
@ -10,6 +10,7 @@ import GHC.TypeLits
|
||||
import qualified Language.Python.Assignment as Python
|
||||
import qualified Language.Ruby.Assignment as Ruby
|
||||
import qualified Language.TypeScript.Assignment as TypeScript
|
||||
import Prologue
|
||||
|
||||
class Preluded syntax where
|
||||
type PreludePath syntax :: Symbol
|
||||
@ -33,7 +34,11 @@ instance Preluded Ruby.Term where
|
||||
instance Preluded Python.Term where
|
||||
type PreludePath Python.Term = "preludes/python.py"
|
||||
|
||||
definePrelude = pure ()
|
||||
definePrelude =
|
||||
define "print" (lambda (\ v -> do
|
||||
print <- variable "__semantic_print" >>= deref
|
||||
void $ call print [variable v]
|
||||
box unit))
|
||||
|
||||
instance Preluded TypeScript.Term where
|
||||
type PreludePath TypeScript.Term = "preludes/javascript.js"
|
||||
|
Loading…
Reference in New Issue
Block a user