mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-25 18:58:56 -06:00
PGFtoPython: add Python translations for nonExist, BIND and SOFT_BIND
Someone who is familiar with the Python translation should check this.
This commit is contained in:
@@ -78,6 +78,9 @@ pySymbol (SymVar n l) = pyDict 0 pyStr id [("var", pyTuple 0 show [n, l])]
|
|||||||
pySymbol (SymKS t) = pyStr t
|
pySymbol (SymKS t) = pyStr t
|
||||||
pySymbol (SymKP ts alts) = pyDict 0 pyStr id [("pre", pyList 0 pySymbol ts), ("alts", pyList 0 alt2py alts)]
|
pySymbol (SymKP ts alts) = pyDict 0 pyStr id [("pre", pyList 0 pySymbol ts), ("alts", pyList 0 alt2py alts)]
|
||||||
where alt2py (ps,ts) = pyTuple 0 (pyList 0 pyStr) [map pySymbol ps, ts]
|
where alt2py (ps,ts) = pyTuple 0 (pyList 0 pyStr) [map pySymbol ps, ts]
|
||||||
|
pySymbol SymBIND = pyStr "&+"
|
||||||
|
pySymbol SymSOFT_BIND = pyStr "&+"
|
||||||
|
pySymbol SymNE = pyDict 0 pyStr id [("nonExist", pyTuple 0 id [])]
|
||||||
|
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
-- python helpers
|
-- python helpers
|
||||||
|
|||||||
Reference in New Issue
Block a user