Михаил Капелько před 1 měsícem
rodič
revize
110b44030d
7 změnil soubory, kde provedl 11 přidání a 3 odebrání
  1. +0
    -0
      _translator-C++-Swift/Function.py
  2. +0
    -0
      _translator-C++-Swift/Type.py
  3. +0
    -0
      _translator-C++-Swift/process.py
  4. +0
    -0
      _translator-C++-Swift/translate
  5. +0
    -0
      main-2.cpp
  6. +1
    -3
      main.py
  7. +10
    -0
      pythonToC++

translator-C++-Swift/Function.py → _translator-C++-Swift/Function.py Zobrazit soubor


translator-C++-Swift/Type.py → _translator-C++-Swift/Type.py Zobrazit soubor


translator-C++-Swift/process.py → _translator-C++-Swift/process.py Zobrazit soubor


translator-C++-Swift/translate → _translator-C++-Swift/translate Zobrazit soubor


+ 0
- 0
main-2.cpp Zobrazit soubor


+ 1
- 3
main.py Zobrazit soubor

@@ -3,9 +3,7 @@

# L4: Function.

def memory_generateConstPlayfield(
n: int
) -> dict[int, int]:
def memory_generateConstPlayfield(n: int) -> dict[int, int]:
idGroups: dict[int, int] = { }
id = 0
for gid in range(0, n):


+ 10
- 0
pythonToC++ Zobrazit soubor

@@ -0,0 +1,10 @@
IN=main.py
OUT=main-2.cpp

# Simple check. TODO REMOVE later
sed 's|# L4: Function.|// L4: Function.|' $IN > $OUT

# dict[X, Y] -> std::map<X, Y>
sed -E 's|dict\[(.*), (.*)\]|std::map<\1, \2>|' $IN > $OUT
# def functionName(X) -> Y -> Y functionName(X) {
sed -E 's|def (.*) -> (.*):|\2 \1 {|' $OUT > $OUT

Načítá se…
Zrušit
Uložit