From 1e44a9f4390822660ec19fe6d025860207688bfe Mon Sep 17 00:00:00 2001 From: pavelyakov Date: Sun, 15 Jul 2018 19:17:28 +0000 Subject: [PATCH] Update support: txt = "test" stdout(txt[1]) stdout: e git-svn-id: svn://kolibrios.org@7307 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/python/library/head.h | 2 ++ programs/cmm/python/library/opcode.h | 18 ++++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/programs/cmm/python/library/head.h b/programs/cmm/python/library/head.h index 762a5a2c05..a6c113fbb4 100644 --- a/programs/cmm/python/library/head.h +++ b/programs/cmm/python/library/head.h @@ -27,6 +27,8 @@ #define PY_DCT 16 #define PY_NA_STR 32 +#define PY_SYM_STR 33 + #define PY_ADD 0 #define PY_POW 1 diff --git a/programs/cmm/python/library/opcode.h b/programs/cmm/python/library/opcode.h index 907d5a6bd0..b2d196cf80 100644 --- a/programs/cmm/python/library/opcode.h +++ b/programs/cmm/python/library/opcode.h @@ -377,6 +377,8 @@ dword x = 0; dword y = 0; dword l = 0; + byte t = 0; + x = popStack(); y = popStack(); @@ -389,8 +391,20 @@ IF(l<=x) test("error max list",0); IF(0>l) test("error min list",0); - y = DSDWORD[y]; - pushStack(DSDWORD[x*4+y]); + t = DSBYTE[y+4]; + + IF(t==PY_LST) + { + y = DSDWORD[y]; + pushStack(DSDWORD[x*4+y]); + return; + } + IF(t==PY_STR) + { + y = DSDWORD[y]; + load_const(y+x,PY_STR,1); + return; + } } /*