diff --git a/requirements.txt b/requirements.txt index 8a281c5..981f42d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,6 +2,7 @@ altgraph==0.15 autopep8==1.3.5 cycler==0.10.0 docutils==0.14 +future==0.16.0 jedi==0.11.1 kiwisolver==1.0.1 macholib==1.9 diff --git a/src/algo/backends/texas.py b/src/algo/backends/texas.py index 512068b..59cf1a5 100644 --- a/src/algo/backends/texas.py +++ b/src/algo/backends/texas.py @@ -4,10 +4,10 @@ from algo.stmts import * from maths.nodes import * from maths.parser import quick_parse as parse -from util import pairwise +from util import lstreplace, pairwise tokens = { - # 'unused': [[0x00]], +# 'unused': [[0x00]], '►DMS': [[0x01]], '►Dec': [[0x02]], '►Frac': [[0x03]], @@ -21,7 +21,7 @@ '°': [[0x0B]], '⁻¹': [[0x0C]], '²': [[0x0D]], - 'ᵀ': [[0x0E]], # matrix transpose + 'ᵀ': [[0x0E]], # matrix transpose '³': [[0x0F]], '(': [[0x10]], ')': [[0x11]], @@ -45,13 +45,13 @@ 'seq(': [[0x23]], 'fnInt(': [[0x24]], 'nDeriv(': [[0x25]], - # 'unused': [[0x26]], +# 'unused': [[0x26]], 'fMin(': [[0x27]], 'fMax(': [[0x28]], ' ': [[0x29]], '"': [[0x2A]], ',': [[0x2B]], - 'ii': [[0x2C], "i"], # imaginary unit + 'ii': [[0x2C], "i"], # imaginary unit '!': [[0x2D]], 'CubicReg ': [[0x2E]], 'QuartReg ': [[0x2F]], @@ -66,7 +66,7 @@ '8': [[0x38]], '9': [[0x39]], '.': [[0x3A]], - 'ᴇ': [[0x3B]], # exponent + 'ᴇ': [[0x3B]], # exponent ' or ': [[0x3C]], ' xor ': [[0x3D]], ':': [[0x3E]], @@ -99,14 +99,14 @@ 'Y': [[0x59]], 'Z': [[0x5A]], 'θ': [[0x5B]], - # '2-byte': [[0x5C]], Matrices - # '2-byte': [[0x5D]], Lists - # '2-byte': [[0x5E]], Equations +# '2-byte': [[0x5C]], Matrices +# '2-byte': [[0x5D]], Lists +# '2-byte': [[0x5E]], Equations 'prgm': [[0x5F]], - # '2-byte': [[0x60]], Pictures - # '2-byte': [[0x61]], GDBs - # '2-byte': [[0x62]], Statistics - # '2-byte': [[0x63]], Window and Finance +# '2-byte': [[0x60]], Pictures +# '2-byte': [[0x61]], GDBs +# '2-byte': [[0x62]], Statistics +# '2-byte': [[0x63]], Window and Finance 'Radian': [[0x64]], 'Degree': [[0x65]], 'Normal': [[0x66]], @@ -133,7 +133,7 @@ 'IndpntAsk': [[0x7B]], 'DependAuto': [[0x7C]], 'DependAsk': [[0x7D]], - # '2-byte': [[0x7E]], Graph Format +# '2-byte': [[0x7E]], Graph Format '□': [[0x7F]], '﹢': [[0x80]], '·': [[0x81]], @@ -177,7 +177,7 @@ 'Tangent(': [[0xA7]], 'DrawInv ': [[0xA8]], 'DrawF ': [[0xA9]], - # '2-byte': [[0xAA]], Strings +# '2-byte': [[0xAA]], Strings 'rand': [[0xAB]], 'π_const': [[0xAC], "π"], 'getKey': [[0xAD]], @@ -194,7 +194,7 @@ 'not(': [[0xB8]], 'iPart(': [[0xB9]], 'fPart(': [[0xBA]], - # '2-byte': [[0xBB]], Miscellaneous +# '2-byte': [[0xBB]], Miscellaneous '√(': [[0xBC]], '³√(': [[0xBD]], 'ln(': [[0xBE]], @@ -246,7 +246,7 @@ 'Plot1(': [[0xEC]], 'Plot2(': [[0xED]], 'Plot3(': [[0xEE]], - # 'TI-84+(C(S)E)': [[0xEF]], TI-84+ +# 'TI-84+(C(S)E)': [[0xEF]], TI-84+ '^': [[0xF0]], '×√': [[0xF1]], '1-Var Stats ': [[0xF2]], @@ -313,7 +313,7 @@ 'r₄': [[0x5E, 0x43]], 'r₅': [[0x5E, 0x44]], 'r₆': [[0x5E, 0x45]], - 'u_': [[0x5E, 0x80]], # sequences todo + 'u_': [[0x5E, 0x80]], # sequences todo 'v_': [[0x5E, 0x81]], 'w_': [[0x5E, 0x82]], @@ -354,7 +354,7 @@ 'Str0': [[0xAA, 0x09]], # Statistics - # 'internal use only': [[0x62, 0x00]], +# 'internal use only': [[0x62, 0x00]], 'RegEq': [[0x62, 0x01]], 'n_stat': [[0x62, 0x02], "n"], 'x̄': [[0x62, 0x03]], @@ -423,7 +423,7 @@ 'Yscl': [[0x63, 0x03]], 'u(nMin)': [[0x63, 0x04]], 'v(nMin)': [[0x63, 0x05]], - 'u(n-1)_wnd': [[0x63, 0x06], "u(n-1)"], # TI-82 compatibility + 'u(n-1)_wnd': [[0x63, 0x06], "u(n-1)"], # TI-82 compatibility 'v(n-1)_wnd': [[0x63, 0x07], "v(n-1)"], 'Zu(nMin)': [[0x63, 0x08]], 'Zv(nMin)': [[0x63, 0x09]], @@ -589,14 +589,14 @@ 'ANOVA(': [[0xBB, 0x59]], 'ModBoxplot': [[0xBB, 0x5A]], 'NormProbPlot': [[0xBB, 0x5B]], - # 'unused': [[0xBB, 0x5C]], - # 'unused': [[0xBB, 0x5D]], - # 'unused': [[0xBB, 0x5E]], - # 'unused': [[0xBB, 0x5F]], - # 'unused': [[0xBB, 0x60]], - # 'unused': [[0xBB, 0x61]], - # 'unused': [[0xBB, 0x62]], - # 'unused': [[0xBB, 0x63]], +# 'unused': [[0xBB, 0x5C]], +# 'unused': [[0xBB, 0x5D]], +# 'unused': [[0xBB, 0x5E]], +# 'unused': [[0xBB, 0x5F]], +# 'unused': [[0xBB, 0x60]], +# 'unused': [[0xBB, 0x61]], +# 'unused': [[0xBB, 0x62]], +# 'unused': [[0xBB, 0x63]], 'G-T': [[0xBB, 0x64]], 'ZoomFit': [[0xBB, 0x65]], 'DiagnosticOn': [[0xBB, 0x66]], @@ -623,7 +623,7 @@ 'è': [[0xBB, 0x7B]], 'ê': [[0xBB, 0x7C]], 'ë': [[0xBB, 0x7D]], - # 'unused': [[0xBB, 0x7E]], +# 'unused': [[0xBB, 0x7E]], 'Ì': [[0xBB, 0x7F]], 'Î': [[0xBB, 0x80]], 'Ï': [[0xBB, 0x81]], @@ -667,7 +667,7 @@ 'π': [[0xBB, 0xA7]], 'ρ': [[0xBB, 0xA8]], 'Σ': [[0xBB, 0xA9]], - # 'unused': [[0xBB, 0xAA]], +# 'unused': [[0xBB, 0xAA]], 'φ': [[0xBB, 0xAB]], 'Ω': [[0xBB, 0xAC]], 'p^_sym': [[0xBB, 0xAD]], @@ -684,7 +684,7 @@ 'i': [[0xBB, 0xB8]], 'j': [[0xBB, 0xB9]], 'k': [[0xBB, 0xBA]], - # 'unused': [[0xBB, 0xBB]], +# 'unused': [[0xBB, 0xBB]], 'l': [[0xBB, 0xBC]], 'm': [[0xBB, 0xBD]], 'n': [[0xBB, 0xBE]], @@ -736,23 +736,23 @@ '→_arr': [[0xBB, 0xEC]], '↑_arr': [[0xBB, 0xED]], '↓_arr': [[0xBB, 0xEE]], - # 'unused': [[0xBB, 0xEF]], +# 'unused': [[0xBB, 0xEF]], 'x_sym': [[0xBB, 0xF0]], '∫': [[0xBB, 0xF1]], '↑_sym': [[0xBB, 0xF2]], '↓_sym': [[0xBB, 0xF3]], '√': [[0xBB, 0xF4]], '[=]': [[0xBB, 0xF5]], - # '': [[0xBB, 0xF6]], - # '': [[0xBB, 0xF7]], - # '': [[0xBB, 0xF8]], - # '': [[0xBB, 0xF9]], - # '': [[0xBB, 0xFA]], - # '': [[0xBB, 0xFB]], - # '': [[0xBB, 0xFC]], - # '': [[0xBB, 0xFD]], - # '': [[0xBB, 0xFE]], - # '': [[0xBB, 0xFF]], +# '': [[0xBB, 0xF6]], +# '': [[0xBB, 0xF7]], +# '': [[0xBB, 0xF8]], +# '': [[0xBB, 0xF9]], +# '': [[0xBB, 0xFA]], +# '': [[0xBB, 0xFB]], +# '': [[0xBB, 0xFC]], +# '': [[0xBB, 0xFD]], +# '': [[0xBB, 0xFE]], +# '': [[0xBB, 0xFF]], # TI-84+ 'setDate(': [[0xEF, 0x00]], @@ -786,23 +786,23 @@ 'ZFrac1/8': [[0xEF, 0x1C]], 'ZFrac1/10': [[0xEF, 0x1D]], 'mathprintbox': [[0xEF, 0x1E]], - # '': [[0xEF, 0x1F]], - # '': [[0xEF, 0x20]], - # '': [[0xEF, 0x21]], - # '': [[0xEF, 0x22]], - # '': [[0xEF, 0x23]], - # '': [[0xEF, 0x24]], - # '': [[0xEF, 0x25]], - # '': [[0xEF, 0x26]], - # '': [[0xEF, 0x27]], - # '': [[0xEF, 0x28]], - # '': [[0xEF, 0x29]], - # '': [[0xEF, 0x2A]], - # '': [[0xEF, 0x2B]], - # '': [[0xEF, 0x2C]], - # '': [[0xEF, 0x2D]], - # '': [[0xEF, 0x2E]], - # '': [[0xEF, 0x2F]], +# '': [[0xEF, 0x1F]], +# '': [[0xEF, 0x20]], +# '': [[0xEF, 0x21]], +# '': [[0xEF, 0x22]], +# '': [[0xEF, 0x23]], +# '': [[0xEF, 0x24]], +# '': [[0xEF, 0x25]], +# '': [[0xEF, 0x26]], +# '': [[0xEF, 0x27]], +# '': [[0xEF, 0x28]], +# '': [[0xEF, 0x29]], +# '': [[0xEF, 0x2A]], +# '': [[0xEF, 0x2B]], +# '': [[0xEF, 0x2C]], +# '': [[0xEF, 0x2D]], +# '': [[0xEF, 0x2E]], +# '': [[0xEF, 0x2F]], '►n/d◄►Un/d': [[0xEF, 0x30]], '►F◄►D': [[0xEF, 0x31]], 'remainder(': [[0xEF, 0x32]], @@ -817,9 +817,9 @@ 'DEC': [[0xEF, 0x3B]], 'FRAC': [[0xEF, 0x3C]], 'FRAC-APPROX': [[0xEF, 0x3D]], - # '': [[0xEF, 0x3E]], - # '': [[0xEF, 0x3F]], - # '': [[0xEF, 0x40]], +# '': [[0xEF, 0x3E]], +# '': [[0xEF, 0x3F]], +# '': [[0xEF, 0x40]], 'BLUE': [[0xEF, 0x41]], 'RED': [[0xEF, 0x42]], 'BLACK': [[0xEF, 0x43]], @@ -847,43 +847,43 @@ 'Image0': [[0xEF, 0x59]], 'Gridline ': [[0xEF, 0x5A]], 'BackgroundOn ': [[0xEF, 0x5B]], - # '': [[0xEF, 0x5C]], - # '': [[0xEF, 0x5D]], - # '': [[0xEF, 0x5E]], - # '': [[0xEF, 0x5F]], - # '': [[0xEF, 0x60]], - # '': [[0xEF, 0x61]], - # '': [[0xEF, 0x62]], - # '': [[0xEF, 0x63]], +# '': [[0xEF, 0x5C]], +# '': [[0xEF, 0x5D]], +# '': [[0xEF, 0x5E]], +# '': [[0xEF, 0x5F]], +# '': [[0xEF, 0x60]], +# '': [[0xEF, 0x61]], +# '': [[0xEF, 0x62]], +# '': [[0xEF, 0x63]], 'BackgroundOff': [[0xEF, 0x64]], 'GraphColor(': [[0xEF, 0x65]], - # '': [[0xEF, 0x66]], +# '': [[0xEF, 0x66]], 'TextColor(': [[0xEF, 0x67]], 'Asm84CPrgm': [[0xEF, 0x68]], - # '': [[0xEF, 0x69]], +# '': [[0xEF, 0x69]], 'DetectAsymOn': [[0xEF, 0x6A]], 'DetectAsymOff': [[0xEF, 0x6B]], 'BorderColor ': [[0xEF, 0x6C]], - # '': [[0xEF, 0x6D]], - # '': [[0xEF, 0x6E]], - # '': [[0xEF, 0x6F]], - # '': [[0xEF, 0x70]], - # '': [[0xEF, 0x71]], - # '': [[0xEF, 0x72]], +# '': [[0xEF, 0x6D]], +# '': [[0xEF, 0x6E]], +# '': [[0xEF, 0x6F]], +# '': [[0xEF, 0x70]], +# '': [[0xEF, 0x71]], +# '': [[0xEF, 0x72]], 'tinydotplot': [[0xEF, 0x73]], 'Thin': [[0xEF, 0x74]], 'Dot-Thin': [[0xEF, 0x75]], - # '': [[0xEF, 0x76]], - # '': [[0xEF, 0x77]], - # '': [[0xEF, 0x78]], +# '': [[0xEF, 0x76]], +# '': [[0xEF, 0x77]], +# '': [[0xEF, 0x78]], 'PlySmth2': [[0xEF, 0x79]], 'Asm84CEPrgm': [[0xEF, 0x7A]], - # '': [[0xEF, 0x7B]], - # '': [[0xEF, 0x7C]], - # '': [[0xEF, 0x7D]], - # '': [[0xEF, 0x7E]], - # '': [[0xEF, 0x7F]], - # '': [[0xEF, 0x80]], +# '': [[0xEF, 0x7B]], +# '': [[0xEF, 0x7C]], +# '': [[0xEF, 0x7D]], +# '': [[0xEF, 0x7E]], +# '': [[0xEF, 0x7F]], +# '': [[0xEF, 0x80]], 'QuartilesSetting…': [[0xEF, 0x81]], 'u(n-2)': [[0xEF, 0x82]], 'v(n-2)': [[0xEF, 0x83]], @@ -908,27 +908,24 @@ 'Wait ': [[0xEF, 0x96]], 'toString(': [[0xEF, 0x97]], 'eval': [[0xEF, 0x98]], - # '': [[0xEF, 0x99]], - # '': [[0xEF, 0x9A]], - # '': [[0xEF, 0x9B]], - # '': [[0xEF, 0x9C]], - # '': [[0xEF, 0x9D]], - # '': [[0xEF, 0x9E]], - # '': [[0xEF, 0x9F]], +# '': [[0xEF, 0x99]], +# '': [[0xEF, 0x9A]], +# '': [[0xEF, 0x9B]], +# '': [[0xEF, 0x9C]], +# '': [[0xEF, 0x9D]], +# '': [[0xEF, 0x9E]], +# '': [[0xEF, 0x9F]], } - def linify(lst): if lst: return lst + ["\n"] return [] - def paren(lst): return ["("] + lst + [")"] - def listjoin(args, sep): res = [] @@ -941,7 +938,6 @@ def listjoin(args, sep): return res - def convert_color(node): colors = [ 'BLUE', @@ -1028,11 +1024,9 @@ def convert_node(node): print("unimpl node %s" % type(node)) - def convert_block(block): return [tok for a, b in pairwise(block) for tok in convert_stmt(a, b)] - def convert_stmt(stmt, next=None): if isinstance(stmt, AssignStmt): return convert_node(stmt.value) + ["→"] + convert_node(stmt.variable) @@ -1130,7 +1124,6 @@ def convert_stmt(stmt, next=None): print("unimpl stmt %s" % type(stmt)) - def stringify(toklst): res = "" @@ -1143,33 +1136,31 @@ def stringify(toklst): return res - def binify(toklst): if toklst: return [bin for tok in toklst for bin in tokens[tok][0]] return [] - def package(name, data): entry = struct.pack(" List[str]: - return [self.to_node().python()] + return ["(%s)(%s)" % (self.function.python(), ", ".join(x.python() for x in self.arguments))] def to_node(self): return CallNode(self.function, self.arguments) diff --git a/src/forms/help.py b/src/forms/help.py index 2447e79..cae4b4c 100644 --- a/src/forms/help.py +++ b/src/forms/help.py @@ -44,8 +44,8 @@ def on_item_select(self): category, function = maths.lib.find_function(current.statusTip(0)) name, args, desc = function[:3] - desc = re.sub(r"{{(\w+)\}\}", "\g<1>", escape(desc)) - desc = re.sub(r"//(\w+)//", "\g<1>", desc) + desc = re.sub(r"{{(\w+)\}\}", r"\g<1>", escape(desc)) + desc = re.sub(r"//(\w+)//", r"\g<1>", desc) html = util.html.centered("

%s

" % maths.lib.docs.get_func_def_html(function)) diff --git a/src/forms/inline_code_editor.py b/src/forms/inline_code_editor.py index d64d701..9c25cee 100644 --- a/src/forms/inline_code_editor.py +++ b/src/forms/inline_code_editor.py @@ -73,8 +73,8 @@ def load_funcs(self): lay.addWidget(label_func) label_desc = QLabel() - desc = re.sub(r"{{(\w+)\}\}", "\g<1>", html.escape(f[2])) - desc = re.sub(r"//(\w+)//", "\g<1>", desc) + desc = re.sub(r"{{(\w+)\}\}", r"\g<1>", html.escape(f[2])) + desc = re.sub(r"//(\w+)//", r"\g<1>", desc) label_desc.setText(desc) diff --git a/src/forms/mainwindow.py b/src/forms/mainwindow.py index 2816941..4ba2613 100644 --- a/src/forms/mainwindow.py +++ b/src/forms/mainwindow.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- -from util.profiler import pf_point, pf_end - import html import json import os @@ -34,7 +32,6 @@ from util import theming, show_error from util.widgets import * - translate = QCoreApplication.translate @@ -141,8 +138,6 @@ class ExecState(): keyword_html = lambda: '' % theming.algo_colors[2] red_html = lambda: '' % theming.algo_colors[3] -label_format = " %s" + " " * 10 - def sleep(duration): begin = datetime.datetime.now() @@ -264,8 +259,7 @@ def article_fetch(language): import urllib.request from xml.etree import ElementTree - response = urllib.request.urlopen( - urllib.request.Request("https://turingapp.ml/%s/feed/" % language, headers={'User-Agent': 'Mozilla/5.0'})) + response = urllib.request.urlopen(urllib.request.Request("https://turingapp.ml/%s/feed/" % language, headers={'User-Agent': 'Mozilla/5.0'})) xml = ElementTree.fromstring(response.read()) result = [] @@ -408,7 +402,8 @@ def refresh_buttons_status(): "Replace", "Run", "Step", - "ConvertToPython" + "ConvertToPython", + "ConvertToPseudocode" ]: get_action(c).setEnabled(active_code) @@ -1106,7 +1101,7 @@ def handler_Open(whichDir=""): """ sel_file, _ = QFileDialog.getOpenFileName( GuiState.window, translate("MainWindow", "Open"), - whichDir or "", + whichDir, ";;".join(GuiState.filters.values())) if not sel_file: @@ -1495,7 +1490,7 @@ def gen_func(item): txt.dclicked.connect(algo_double_click) item.lbl = txt GuiState.ui.treeWidget.setItemWidget(item, 0, txt) - + GuiState.ui.treeWidget.header().setSectionResizeMode(QHeaderView.ResizeToContents) return txt @@ -1506,8 +1501,7 @@ def get_item_html(html, data=""): item.setFont(0, GuiState.ui.treeWidget.font()) lbl = get_item_label(item) lbl.setFont(item.font(0)) - lbl.setText(label_format % html) - item.setSizeHint(0, lbl.sizeHint()) + lbl.setText(' %s' % html) GuiState.ui.treeWidget.setItemWidget(item, 0, lbl) @@ -1517,7 +1511,7 @@ def get_item_html(html, data=""): def refresh_algo_text(): for item, stmt in GuiState.item_map.values(): lbl = get_item_label(item) - lbl.setText(label_format % str_stmt(stmt)) + lbl.setText(' %s' % str_stmt(stmt)) def add_display(): @@ -2327,8 +2321,6 @@ def init_ui(): load_languages() - GuiState.ui.treeWidget.header().setSectionResizeMode(QHeaderView.ResizeToContents) - GuiState.algo_base_font = GuiState.ui.treeWidget.font() recent_init_actions() @@ -2493,7 +2485,6 @@ def autosave_clear(): def clean_exit(): autosave_clear() GuiState.code_editor.backend.stop() - pf_end() sys.exit() @@ -2506,9 +2497,7 @@ def version_check(): import urllib.request import re - result = json.load(urllib.request.urlopen( - urllib.request.Request("https://api.github.com/repos/TuringApp/Turing/releases/latest", - headers={'User-Agent': 'Mozilla/5.0'}))) + result = json.load(urllib.request.urlopen(urllib.request.Request("https://api.github.com/repos/TuringApp/Turing/releases/latest", headers={'User-Agent': 'Mozilla/5.0'}))) if result and type(result) == dict and "tag_name" in result: version = re.findall(r"[\d.]+", result["tag_name"])[0] diff --git a/src/forms/ui_mainwindow.ui b/src/forms/ui_mainwindow.ui index 5b4c588..f046a74 100644 --- a/src/forms/ui_mainwindow.ui +++ b/src/forms/ui_mainwindow.ui @@ -174,9 +174,6 @@ true - - false - 1 @@ -784,6 +781,7 @@ + @@ -1654,4 +1652,4 @@ p, li { white-space: pre-wrap; } - + \ No newline at end of file diff --git a/src/lang/de.ts b/src/lang/de.ts index fc47ede..47e2b98 100644 --- a/src/lang/de.ts +++ b/src/lang/de.ts @@ -4,26 +4,26 @@ AboutWindow - + About Turing Über Turing - + Program Programm - + License Lizenz - + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Turing {version}</span></p> <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Release channel : </span>{channel} <br /><br />Free and open-source software to assist the learning of algorithms and programming. <br /><br /><span style=" font-weight:600;">Copyright (c) 2018 the Turing development team (Léo Joly, Tom Niget)</span></p> <ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">This software is distributed under the terms of the MIT license and makes use of the <a href="https://www.qt.io/"><span style=" text-decoration: underline; color:#0000ff;">Qt</span></a> / <a href="https://riverbankcomputing.com/software/pyqt/"><span style=" text-decoration: underline; color:#0000ff;">pyQt</span></a>. frameworks.</li> @@ -39,97 +39,97 @@ p, li { white-space: pre-wrap; } Algo - + [k]BREAK[/k] [k]VERLASSEN[/k] - + [k]CONTINUE[/k] [k]FORTSETZEN[/k] - + [b]ELSE[/b] [b]SONST[/b] - + [b]WHILE[/b] [c]{cond}[/c] [b]SOLANGE[/b] [c]{cond}[/c] - + [b]IF[/b] [c]{cond}[/c] [b]WENN[/b] [c]{cond}[/c] - + [k]DECLARE[/k] [c]{var}[/c] [k]DEKLARIEREN[/k] [c]{var}[/c] - + [k]CALL[/k] [c]{code}[/c] [k]AUFRUFEN[/k] [c]{code}[/c] - + [b]FOR[/b] [c]{var}[/c] [b]FROM[/b] [c]{begin}[/c] [b]TO[/b] [c]{end}[/c] {step} [b]FÜR[/b] [c]{var}[/c] [b]VON[/b] [c]{begin}[/c] [b]BIS[/b] [c]{end}[/c] {step} - + ([b]STEP[/b] [c]{step}[/c]) ([b]SCHRITTWEITE[/b] [c]{step}[/c]) - + [b]FUNCTION[/b] [c]{func}({args})[/c] [b]FUNKTION[/b] [c]{func}({args})[/c] - + [k]RETURN[/k] [c]{val}[/c] [k]ZURÜCKGEBEN[/k] [c]{val}[/c] - + [k]STOP[/k] [c]{val}[/c] [k]UNTERBRECHEN[/k] [c]{val}[/c] - + [k]WAIT[/k] [c]{val}[/c] [k]SECONDS[/k] [k]WARTEN[/k] [c]{val}[/c] [k]SEKUNDEN[/k] - + [k]CLEAR PLOT[/k] - + [k]DRAW LINE[/k] [c]{color}[/c] [k]FROM[/k] ([c]{start_x}[/c]; [c]{start_y}[/c]) [k]TO[/k] ([c]{end_x}[/c]; [c]{end_y}[/c]) - + [k]DRAW POINT[/k] [c]{color}[/c] [k]AT[/k] ([c]{x}[/c]; [c]{y}[/c]) - + [k]PLOT FUNCTION[/k] [c]{color}[/c] [i]f[/i]({var}) = [c]{expr}[/c] [k]FROM[/k] [c]{begin}[/c] [k]TO[/k] [c]{end}[/c] [k]STEP[/k] [c]{step}[/c] - + [b]PROGRAM[/b] [b]PROGRAMM[/b] - + [i]empty[/i] [i]frei[/i] @@ -201,27 +201,27 @@ p, li { white-space: pre-wrap; } - + [k]SET WINDOW[/k] [i]Xmin=[/i][c]{x_min}[/c] [i]Xmax=[/i][c]{x_max}[/c] [i]Ymin=[/i][c]{y_min}[/c] [i]Ymax=[/i][c]{y_max}[/c] [i]Xgrad=[/i][c]{x_grad}[/c] [i]Ygrad=[/i][c]{y_grad}[/c] - + [k]VARIABLE[/k] [c]{var}[/c] [k]TAKES VALUE[/k] [c]{value}[/c] - + [k]DISPLAY[/k] [c]{val}[/c] {newline} - + [k]INPUT[/k] [c]{prompt}[/c] [k]TO[/k] [c]{var}[/c] {text} - + [c]{var}[/c] [k]&#129128;[/k] [c]{value}[/c] @@ -1658,663 +1658,663 @@ Window Text : MainWindow - + Home Start - + Pseudocode Pseudocode - + Duplicate Line shorter - + Delete Line - + Edit Line - + Zoom in Vergrößern - + Zoom out Verkleinern - + Reset zoom Standardgröße - + Basic Basisch - + Breakpoint Haltepunkt - + Read user INPUT BENUTZEREINGABEN lesen - + DISPLAY value - + Comment Kommentar - + Wait Warten - + Blocks - + WHILE loop SOLANGE Schleife - + ELSE block - + FOR loop FÜR Schleife - + IF block - + CONTINUE - + BREAK VERLASSEN - + Functions Funktionen - + CALL function Funktion AUFRUFEN - + Define FUNCTION - + RETURN ZURÜCKGEBEN - + Plot - + Set window Grafikfensters - + Clear plot - + Draw point Plotten Punktes - + Draw line Plotten Linie - + Plot function Plotten Funktion - + Code - + &File &Datei - + &Edit &Bearbeiten - + &Help - &Hilfe + - + &View &Ansicht - + Change theme - + Change style - + &Program - + &Tools &Werkzeuge - + Toolbar Symbolleiste - + Output - + Clear Output - + Save Output - + Print Output - + New Neu - + Open Öffnen - + Save Speichern - + Save As Speichern unter - + Exit Beenden - + Save All Alle speichern - + Undo Rückgängig - + Redo Wiederherstellen - + Cut Ausschneiden - + Copy Kopieren - + Paste Einfügen - + Quick Start Schnellstart - + Help Contents Hilfethemen - + About Turing Über Turing - + Show toolbar Symbolleiste anzeigen - + Examples Beispiele - + Print Ausgeben - + Find Suchen - + Replace Ersetzen - + Calculator Rechner - + Clear Löschen - + Select All Alles auswählen - + Run Ausführen - + Step-by-step - + Show toolbar text - + Convert to Python - + Convert to pseudocode - + Duplicate Line - + Indent Zeileneinzug vergrößern - + Unindent Zeileneinzug verkleinern - + Go To Line Gehe zu Zeile - + Find Previous Rückwärts suchen - + Find Next Weitersuchen - + Stop Beenden - + Debug Debuggen - + Send Feedback Feedback senden - + Do you really want to exit? All unsaved changes will be lost. Möchten Sie wirklich beenden? Alle nicht gespeicherten Änderungen gehen verloren. - + Turing - {file} (unsaved) Turing - {file} (geändert) - + Turing - {file} Turing - {file} - + Turing - New File Turing - Unbenannt - + Input: Eingeben: - + end of output - + end of output [{time}] - + Breakpoint: Haltepunkt: - + program interrupted - + Syntax error ({type}) at line {line}, offset {off}: - + Save output Ausgabedaten speichern - + Text files (*.txt) Textdateien (*.txt) - + Do you really want to create a new file? All unsaved changes will be lost. - + Advanced Erweitert - + Folding Faltung - + Collapse Reduzieren - + Expand Erweitern - + Collapse all Alle reduzieren - + Expand all Alle erweitern - + Select word - + Select extended word - + Matched select - + Select line - + Select Auswahl - + Regex Reguläre Ausdrücke - + Match case Groß-/Kleinschreibung beachten - + Whole words Übereinstimmung mit ganzem Wort - + In Selection - + 0 matches 0 Treffer - + Replace All Alle ersetzen - + {num} matches {num} Treffer - + Program file (*.py *.tr *.alg) - + Python file (*.py) Python Dateien (*.py) - + Turing program (*.tr) - + Algobox file (*.alg) Algobox Dateien (*.alg) - + A new version of Turing is available. Would you like to download it? - + A modified file has been automatically saved. Would you like to recover it? - + Zoom Zoom - + Edit theme - + Settings Einstellungen - + Use arrow notation - + ASSIGN variable - + Recent files Header Zuletzt verwendet - + Recent articles Header - + Recent files Menu Zuletzt verwendet - + Load recent articles - + Check for updates - + You are about to choose an example file from the `examples` directory. To guess what examples are, you can guess from the file names. - + You are not allowed to write to {}, please choose another file path. diff --git a/src/lang/es.ts b/src/lang/es.ts index 55792fc..0b569b4 100644 --- a/src/lang/es.ts +++ b/src/lang/es.ts @@ -4,26 +4,26 @@ AboutWindow - + About Turing Acerca de Turing - + Program - + License Licencia - + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Turing {version}</span></p> <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Release channel : </span>{channel} <br /><br />Free and open-source software to assist the learning of algorithms and programming. <br /><br /><span style=" font-weight:600;">Copyright (c) 2018 the Turing development team (Léo Joly, Tom Niget)</span></p> <ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">This software is distributed under the terms of the MIT license and makes use of the <a href="https://www.qt.io/"><span style=" text-decoration: underline; color:#0000ff;">Qt</span></a> / <a href="https://riverbankcomputing.com/software/pyqt/"><span style=" text-decoration: underline; color:#0000ff;">pyQt</span></a>. frameworks.</li> @@ -39,104 +39,104 @@ p, li { white-space: pre-wrap; } Algo - + [k]BREAK[/k] - + [k]CONTINUE[/k] - + [b]ELSE[/b] - + [b]WHILE[/b] [c]{cond}[/c] - + [b]IF[/b] [c]{cond}[/c] - + [k]DECLARE[/k] [c]{var}[/c] - + [k]CALL[/k] [c]{code}[/c] - + [b]FOR[/b] [c]{var}[/c] [b]FROM[/b] [c]{begin}[/c] [b]TO[/b] [c]{end}[/c] {step} - + ([b]STEP[/b] [c]{step}[/c]) - + [b]FUNCTION[/b] [c]{func}({args})[/c] - + [k]RETURN[/k] [c]{val}[/c] - + [k]STOP[/k] [c]{val}[/c] - + [k]WAIT[/k] [c]{val}[/c] [k]SECONDS[/k] - + [k]CLEAR PLOT[/k] - + [k]DRAW LINE[/k] [c]{color}[/c] [k]FROM[/k] ([c]{start_x}[/c]; [c]{start_y}[/c]) [k]TO[/k] ([c]{end_x}[/c]; [c]{end_y}[/c]) - + [k]DRAW POINT[/k] [c]{color}[/c] [k]AT[/k] ([c]{x}[/c]; [c]{y}[/c]) - + [k]PLOT FUNCTION[/k] [c]{color}[/c] [i]f[/i]({var}) = [c]{expr}[/c] [k]FROM[/k] [c]{begin}[/c] [k]TO[/k] [c]{end}[/c] [k]STEP[/k] [c]{step}[/c] - + [b]PROGRAM[/b] - + [i]empty[/i] Variable {var} = - Variable {var} = + @@ -201,27 +201,27 @@ p, li { white-space: pre-wrap; } - + [k]SET WINDOW[/k] [i]Xmin=[/i][c]{x_min}[/c] [i]Xmax=[/i][c]{x_max}[/c] [i]Ymin=[/i][c]{y_min}[/c] [i]Ymax=[/i][c]{y_max}[/c] [i]Xgrad=[/i][c]{x_grad}[/c] [i]Ygrad=[/i][c]{y_grad}[/c] - + [k]VARIABLE[/k] [c]{var}[/c] [k]TAKES VALUE[/k] [c]{value}[/c] - + [k]DISPLAY[/k] [c]{val}[/c] {newline} - + [k]INPUT[/k] [c]{prompt}[/c] [k]TO[/k] [c]{var}[/c] {text} - + [c]{var}[/c] [k]&#129128;[/k] [c]{value}[/c] @@ -1591,7 +1591,7 @@ Window Text : and - y + @@ -1652,668 +1652,668 @@ Window Text : Expression editor - Editor de expresiones + MainWindow - + Home - + Pseudocode - + Duplicate Line shorter - + Delete Line - + Edit Line - + Zoom in Aumentar zoom - + Zoom out Disminuir zoom - + Reset zoom Restaurar - + Basic Básico - + Breakpoint Punto de ruptura - + Read user INPUT - + DISPLAY value - + Comment Comentario - + Wait - + Blocks - + WHILE loop - + ELSE block - + FOR loop Bucle PARA - + IF block - + CONTINUE - + BREAK - + Functions - + CALL function - + Define FUNCTION - + RETURN - + Plot - + Set window - Ventana del gráfico + Configurar la ventana del gráfico - + Clear plot - + Draw point Trazar punto - + Draw line Trazar línea - + Plot function Trazar función - + Code - + &File &Archivo - + &Edit &Editar - + &Help - &Ayuda + - + &View &Vista - + Change theme - + Change style - + &Program - + &Tools &Herramientas - + Toolbar - + Output - + Clear Output - + Save Output - + Print Output - + New Nuevo - + Open Abrir - + Save Guardar - + Save As Guardar como - + Exit Salir - + Save All Guardar todo - + Undo Deshacer - + Redo Rehacer - + Cut Cortar - + Copy Copiar - + Paste Pegar - + Quick Start - Inicio rápido + - + Help Contents Ayuda - + About Turing Acerca de Turing - + Show toolbar - Mostrar barra de herramientas + - + Examples - + Print Imprimir - + Find Buscar - + Replace Reemplazar - + Calculator Calculadora - + Clear - + Select All Seleccionar todo - + Run Ejecutar - + Step-by-step - + Show toolbar text - + Convert to Python - + Convert to pseudocode - + Duplicate Line - + Indent Aumentar guion de línea - + Unindent Reducir guion de línea - + Go To Line - + Find Previous Buscar anterior - + Find Next Buscar siguiente - + Stop - + Debug - + Send Feedback - + Do you really want to exit? All unsaved changes will be lost. - + Turing - {file} (unsaved) - + Turing - {file} Turing - {file} - + Turing - New File - + Input: - + end of output - + end of output [{time}] - + Breakpoint: - + program interrupted - + Syntax error ({type}) at line {line}, offset {off}: - + Save output - + Text files (*.txt) - + Do you really want to create a new file? All unsaved changes will be lost. - + Advanced - + Folding - + Collapse - + Expand - + Collapse all - + Expand all - + Select word - + Select extended word - + Matched select - + Select line - + Select - + Regex Expresión regular - + Match case Coincidir MAYÚSCULAS/minúsculas - + Whole words Solo palabras completas - + In Selection - + 0 matches - + Replace All - + {num} matches - + Program file (*.py *.tr *.alg) - + Python file (*.py) - + Turing program (*.tr) - + Algobox file (*.alg) - + A new version of Turing is available. Would you like to download it? - + A modified file has been automatically saved. Would you like to recover it? - + Zoom Zoom - + Edit theme - + Settings Ajustes - + Use arrow notation - + ASSIGN variable - + Recent files Header Archivos recientes - + Recent articles Header - + Recent files Menu Archivos recientes - + Load recent articles - + Check for updates - + You are about to choose an example file from the `examples` directory. To guess what examples are, you can guess from the file names. - + You are not allowed to write to {}, please choose another file path. diff --git a/src/lang/fr.ts b/src/lang/fr.ts index 360dcb2..2abf8e8 100644 --- a/src/lang/fr.ts +++ b/src/lang/fr.ts @@ -4,26 +4,26 @@ AboutWindow - + About Turing À propos de Turing - + Program Programme - + License Licence - + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Turing {version}</span></p> <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Release channel : </span>{channel} <br /><br />Free and open-source software to assist the learning of algorithms and programming. <br /><br /><span style=" font-weight:600;">Copyright (c) 2018 the Turing development team (Léo Joly, Tom Niget)</span></p> <ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">This software is distributed under the terms of the MIT license and makes use of the <a href="https://www.qt.io/"><span style=" text-decoration: underline; color:#0000ff;">Qt</span></a> / <a href="https://riverbankcomputing.com/software/pyqt/"><span style=" text-decoration: underline; color:#0000ff;">pyQt</span></a>. frameworks.</li> @@ -58,90 +58,90 @@ p, li { white-space: pre-wrap; } BREAK can only be used inside a loop - SORTIR ne peut être utilisé qu'à l'intérieur d'une boucle + SORTIR ne peut être utilisé qu'à l'intérieur d'une boucle CONTINUE can only be used inside a loop - CONTINUER ne peut être utilisé qu'à l'intérieur d'une boucle + CONTINUER ne peut être utilisé qu'à l'intérieur d'une boucle RETURN can only be used inside a function - RENVOYER ne peut être utilisé qu'à l'intérieur d'une fonction + RENVOYER ne peut être utilisé qu'à l'intérieur d'une fonction Unknown statement type: {type} - Type d'instruction inconnu : {type} + Type d'instruction inconnu : {type} ELSE can only be used after an IF block - SINON ne peut être utilisé qu'immédiatement après un bloc SI + SINON ne peut être utilisé qu'immédiatement après un bloc SI - + [k]CONTINUE[/k] [k]CONTINUER[/k] - + [b]ELSE[/b] [b]SINON[/b] - + [b]WHILE[/b] [c]{cond}[/c] [b]TANT QUE[/b] [c]{cond}[/c] - + [b]IF[/b] [c]{cond}[/c] [b]SI[/b] [c]{cond}[/c] - + [k]RETURN[/k] [c]{val}[/c] [k]RENVOYER[/k] [c]{val}[/c] - + [k]DECLARE[/k] [c]{var}[/c] [k]DÉCLARER[/k] [c]{var}[/c] - + [k]CALL[/k] [c]{code}[/c] [k]APPELER[/k] [c]{code}[/c] - + [b]FUNCTION[/b] [c]{func}({args})[/c] [b]FONCTION[/b] [c]{func}({args})[/c] - + [b]PROGRAM[/b] [b]ALGORITHME[/b] - + [k]BREAK[/k] [k]SORTIR[/k] - + [b]FOR[/b] [c]{var}[/c] [b]FROM[/b] [c]{begin}[/c] [b]TO[/b] [c]{end}[/c] {step} [b]POUR[/b] [c]{var}[/c] [b]DE[/b] [c]{begin}[/c] [b]À[/b] [c]{end}[/c] {step} - + ([b]STEP[/b] [c]{step}[/c]) ([b]PAS[/b] [c]{step}[/c]) - + [i]empty[/i] [i]vide[/i] @@ -167,75 +167,75 @@ p, li { white-space: pre-wrap; } Array access target must be of array type - La cible d'un accès de liste doit être une liste + La cible d'un accès de liste doit être une liste Index '{idx}' too big for array - Indice '{idx}' trop grand pour la liste + Indice '{idx}' trop grand pour la liste Assignment target must be either variable or array item - La cible d'une affectation doit être une variable ou un élément de liste + La cible d'une affectation doit être une variable ou un élément de liste Invalid assignment target (must be either variable or array item): {name} - Cible d'affectation invalide (doit être une variable ou un élément de liste) : {name} + Cible d'affectation invalide (doit être une variable ou un élément de liste) : {name} - + [k]VARIABLE[/k] [c]{var}[/c] [k]TAKES VALUE[/k] [c]{value}[/c] [k]VARIABLE[/k] [c]{var}[/c] [k]PREND LA VALEUR[/b] [c]{value}[/c] - + [k]CLEAR PLOT[/k] [k]EFFACER GRAPHIQUE[/k] - + [k]DRAW LINE[/k] [c]{color}[/c] [k]FROM[/k] ([c]{start_x}[/c]; [c]{start_y}[/c]) [k]TO[/k] ([c]{end_x}[/c]; [c]{end_y}[/c]) [k]DESSINER LIGNE[/k] [c]{color}[/c] [k]DE[/k] ([c]{start_x}[/c]; [c]{start_y}[/c]) [k]À[/k] ([c]{end_x}[/c]; [c]{end_y}[/c]) - + [k]DRAW POINT[/k] [c]{color}[/c] [k]AT[/k] ([c]{x}[/c]; [c]{y}[/c]) [k]DESSINER POINT[/k] [c]{color}[/c] [k]À[/k] ([c]{x}[/c]; [c]{y}[/c]) - + [k]SET WINDOW[/k] [i]Xmin=[/i][c]{x_min}[/c] [i]Xmax=[/i][c]{x_max}[/c] [i]Ymin=[/i][c]{y_min}[/c] [i]Ymax=[/i][c]{y_max}[/c] [i]Xgrad=[/i][c]{x_grad}[/c] [i]Ygrad=[/i][c]{y_grad}[/c] [k]DÉFINIR REPÈRE[/k] [i]Xmin=[/i][c]{x_min}[/c] [i]Xmax=[/i][c]{x_max}[/c] [i]Ymin=[/i][c]{y_min}[/c] [i]Ymax=[/i][c]{y_max}[/c] [i]Xgrad=[/i][c]{x_grad}[/c] [i]Ygrad=[/i][c]{y_grad}[/c] - + [k]STOP[/k] [c]{val}[/c] [k]STOP[/k] [c]{val}[/c] - + [k]PLOT FUNCTION[/k] [c]{color}[/c] [i]f[/i]({var}) = [c]{expr}[/c] [k]FROM[/k] [c]{begin}[/c] [k]TO[/k] [c]{end}[/c] [k]STEP[/k] [c]{step}[/c] [k]TRACER FONCTION[/k] [c]{color}[/c] [i]f[/i]({var}) = [c]{expr}[/c] [k]DE[/k] [c]{begin}[/c] [k]À[/k] [c]{end}[/c] [k]PAS[/k] [c]{step}[/c] - + [k]WAIT[/k] [c]{val}[/c] [k]SECONDS[/k] [k]ATTENDRE[/k] [c]{val}[/c] [k]SECONDES[/k] - + [k]DISPLAY[/k] [c]{val}[/c] {newline} [k]AFFICHER[/k] [c]{val}[/c] {newline} - + [k]INPUT[/k] [c]{prompt}[/c] [k]TO[/k] [c]{var}[/c] {text} [k]SAISIR[/k] [c]{var}[/c] {text} - + [c]{var}[/c] [k]&#129128;[/k] [c]{value}[/c] [c]{var}[/c] [k]&#129128;[/k] [c]{value}[/c] @@ -1668,679 +1668,679 @@ désactivé : InlineCodeDialog - + Expression editor - Éditeur d'expression + Éditeur d'expression MainWindow - + Home Accueil - + &File &Fichier - + &Edit &Édition - + &Help &Aide - + &View &Affichage - + &Program &Programme - + &Tools O&utils - + Output Sortie - + New Nouveau - + Open Ouvrir - + Save Enregistrer - + Save As Enregistrer sous - + Exit Quitter - + Save All Enregistrer tout - + Undo Annuler - + Redo Rétablir - + Cut Couper - + Copy Copier - + Paste Coller - + Quick Start Tutoriel rapide - + Help Contents Bibliothèque - + About Turing À propos de Turing - + Show toolbar - Barre d'outils + Barre d'outils - + Examples Exemples - + Print Imprimer - + Find Rechercher - + Replace Remplacer - + Calculator Calculatrice - + Clear Effacer - + Select All Sélectionner tout - + Run Exécuter - + Step-by-step Pas-à-pas - + Show toolbar text Texte des boutons - + Convert to Python Convertir en Python - + Convert to pseudocode Convertir en pseudocode - + Do you really want to exit? All unsaved changes will be lost. Voulez-vous vraiment quitter ? Toutes les modifications non sauvegardées seront perdues. - + Toolbar - Barre d'outils + Barre d'outils - + Pseudocode Algorithme - + Code Code - + end of output - fin de l'exécution + fin de l'exécution - + Input: Saisir : - + Syntax error ({type}) at line {line}, offset {off}: Erreur de syntaxe ({type}) à la ligne {line}, caractère {off} : - + Indent - Augmenter l'indentation + Augmenter l'indentation - + Unindent - Réduire l'indentation + Réduire l'indentation - + Duplicate Line Dupliquer la ligne - + Go To Line Aller à la ligne - + Find Previous Rechercher précédent - + Find Next Rechercher suivant - + Change theme Changer de thème - + Change style Changer de style - + Clear Output Effacer la sortie - + Save Output Enregistrer la sortie - + Print Output Imprimer la sortie - + FOR loop Boucle POUR - + WHILE loop Boucle TANT QUE - + IF block Bloc SI - + ELSE block Bloc SINON - + BREAK SORTIR - + CONTINUE CONTINUER - + Stop Arrêter - + Comment Commentaire - + program interrupted algorithme interrompu - + end of output [{time}] - fin de l'exécution [{time}] + fin de l'exécution [{time}] - + Python file (*.py) Fichier Python (*.py) - + Turing program (*.tr) Algorithme Turing (*.tr) - + Algobox file (*.alg) Algorithme Algobox (*.alg) - + Define FUNCTION Définir FONCTION - + CALL function APPELER fonction - + RETURN RENVOYER - + Read user INPUT SAISIR une entrée - + DISPLAY value AFFICHER valeur - + Turing - New File Turing - Sans titre - + Turing - {file} (unsaved) Turing - {file} (modifié) - + Turing - {file} Turing - {file} - + Debug Déboguer - + Program file (*.py *.tr *.alg) Fichier de programme (*.py *.tr *.alg) - + Clear plot Effacer graphique - + Draw point Dessiner point - + Draw line Dessiner ligne - + Plot Graphique - + Set window Définir le repère - + Save output Enregistrer la sortie - + Text files (*.txt) Fichiers texte (*.txt) - + Do you really want to create a new file? All unsaved changes will be lost. Voulez-vous vraiment créer un nouveau fichier ? Toutes les modifications non sauvegardées seront perdues. - + Send Feedback Un commentaire ? - + A new version of Turing is available. Would you like to download it? Une nouvelle version de Turing est disponible. Voulez-vous la télécharger ? - + Breakpoint - Point d'arrêt + Point d'arrêt - + Breakpoint: - Point d'arrêt : + Point d'arrêt : - + Zoom in Agrandir - + Zoom out Réduire - + Reset zoom Par défaut - + Advanced Avancé - + Delete Line Supprimer - + Edit Line Modifier - + Duplicate Line shorter Dupliquer - + Folding Plan - + Collapse Réduire - + Expand Étendre - + Expand all Tout étendre - + Select word Sélectionner le mot - + Select extended word Sélectionner le mot étendu - + Matched select Sélectionner le résultat - + Select line Sélectionner la ligne - + Select Sélection - + Collapse all Tout réduire - + Regex Expression régulière - + Match case Respecter la casse - + Whole words Mot entier - + In Selection Dans la sélection - + 0 matches 0 correspondances - + Replace All Remplacer tout - + Basic Basique - + Blocks Blocs - + Functions Fonctions - + Plot function Tracer fonction - + Wait Attendre - + {num} matches {num} correspondances - + A modified file has been automatically saved. Would you like to recover it? Un fichier modifié a été enregistré automatiquement. Souhaitez-vous le récupérer ? - + Zoom Zoom - + Edit theme Modifier le thème - + Settings Options - + Use arrow notation Utiliser la notation fléchée - + ASSIGN variable AFFECTER variable - + Recent files Header Fichiers récents - + Recent articles Header Articles récents - + Recent files Menu Récents - + Load recent articles Charger les articles récents - + Check for updates Vérifier les mises à jour - + You are about to choose an example file from the `examples` directory. To guess what examples are, you can guess from the file names. - Vous allez choisir un fichier d'exemple -depuis le répertoire « examples ». Pour devinece qu'il y a + Vous allez choisir un fichier d'exemple +depuis le répertoire « examples ». Pour devinece qu'il y a dans les fichiers, fiez-vous à leurs noms. - + You are not allowed to write to {}, please choose another file path. - Vous n'êtes pas autorisé à écrire dans {}, + Vous n'êtes pas autorisé à écrire dans {}, veuillez choisir un chemin vers un autre fichier. diff --git a/src/lang/it.ts b/src/lang/it.ts index e9046d6..fcb0afa 100644 --- a/src/lang/it.ts +++ b/src/lang/it.ts @@ -4,26 +4,26 @@ AboutWindow - + About Turing - + Program - + License - + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Turing {version}</span></p> <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Release channel : </span>{channel} <br /><br />Free and open-source software to assist the learning of algorithms and programming. <br /><br /><span style=" font-weight:600;">Copyright (c) 2018 the Turing development team (Léo Joly, Tom Niget)</span></p> <ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">This software is distributed under the terms of the MIT license and makes use of the <a href="https://www.qt.io/"><span style=" text-decoration: underline; color:#0000ff;">Qt</span></a> / <a href="https://riverbankcomputing.com/software/pyqt/"><span style=" text-decoration: underline; color:#0000ff;">pyQt</span></a>. frameworks.</li> @@ -39,104 +39,104 @@ p, li { white-space: pre-wrap; } Algo - + [k]BREAK[/k] - + [k]CONTINUE[/k] - + [b]ELSE[/b] - + [b]WHILE[/b] [c]{cond}[/c] - + [b]IF[/b] [c]{cond}[/c] - + [k]DECLARE[/k] [c]{var}[/c] - + [k]CALL[/k] [c]{code}[/c] - + [b]FOR[/b] [c]{var}[/c] [b]FROM[/b] [c]{begin}[/c] [b]TO[/b] [c]{end}[/c] {step} - + ([b]STEP[/b] [c]{step}[/c]) - + [b]FUNCTION[/b] [c]{func}({args})[/c] - + [k]RETURN[/k] [c]{val}[/c] - + [k]STOP[/k] [c]{val}[/c] - + [k]WAIT[/k] [c]{val}[/c] [k]SECONDS[/k] - + [k]CLEAR PLOT[/k] - + [k]DRAW LINE[/k] [c]{color}[/c] [k]FROM[/k] ([c]{start_x}[/c]; [c]{start_y}[/c]) [k]TO[/k] ([c]{end_x}[/c]; [c]{end_y}[/c]) - + [k]DRAW POINT[/k] [c]{color}[/c] [k]AT[/k] ([c]{x}[/c]; [c]{y}[/c]) - + [k]PLOT FUNCTION[/k] [c]{color}[/c] [i]f[/i]({var}) = [c]{expr}[/c] [k]FROM[/k] [c]{begin}[/c] [k]TO[/k] [c]{end}[/c] [k]STEP[/k] [c]{step}[/c] - + [b]PROGRAM[/b] - + [i]empty[/i] Variable {var} = - Variabile {var} = + @@ -201,27 +201,27 @@ p, li { white-space: pre-wrap; } - + [k]SET WINDOW[/k] [i]Xmin=[/i][c]{x_min}[/c] [i]Xmax=[/i][c]{x_max}[/c] [i]Ymin=[/i][c]{y_min}[/c] [i]Ymax=[/i][c]{y_max}[/c] [i]Xgrad=[/i][c]{x_grad}[/c] [i]Ygrad=[/i][c]{y_grad}[/c] - + [k]VARIABLE[/k] [c]{var}[/c] [k]TAKES VALUE[/k] [c]{value}[/c] - + [k]DISPLAY[/k] [c]{val}[/c] {newline} - + [k]INPUT[/k] [c]{prompt}[/c] [k]TO[/k] [c]{var}[/c] {text} - + [c]{var}[/c] [k]&#129128;[/k] [c]{value}[/c] @@ -1591,7 +1591,7 @@ Window Text : and - e + @@ -1652,668 +1652,668 @@ Window Text : Expression editor - Editor espressioni + MainWindow - + Home - + Pseudocode - + Duplicate Line shorter - + Delete Line - + Edit Line - + Zoom in Ingrandisci testo - + Zoom out Riduci testo - + Reset zoom Reimposta - + Basic - + Breakpoint Punto di interruzione - + Read user INPUT - + DISPLAY value - + Comment Commenta - + Wait - + Blocks - + WHILE loop - + ELSE block - + FOR loop - + IF block - + CONTINUE - + BREAK - + Functions - + CALL function - + Define FUNCTION - + RETURN - + Plot - + Set window - Finestra del grafico + Impostare la finestra del grafico - + Clear plot - + Draw point Tracciare punto - + Draw line Tracciare linea - + Plot function Tracciare funzione - + Code - + &File &File - + &Edit &Modifica - + &Help - &Guida + - + &View &Visualizza - + Change theme - + Change style - + &Program - + &Tools &Strumenti - + Toolbar - + Output - + Clear Output - + Save Output - + Print Output - + New Nuovo - + Open Apri - + Save Salva - + Save As Salva come - + Exit Esci - + Save All Salva tutto - + Undo Annulla - + Redo Ripristina - + Cut Taglia - + Copy Copia - + Paste Incolla - + Quick Start - Guida introduttiva + - + Help Contents Sommario Guida - + About Turing - + Show toolbar - Mostra barra degli strumenti + - + Examples - + Print Stampa - + Find Trova - + Replace Sostituisci - + Calculator Calcolatrice - + Clear - + Select All Seleziona tutto - + Run Esegui - + Step-by-step - + Show toolbar text - + Convert to Python - + Convert to pseudocode - + Duplicate Line - + Indent Inserisci tabulazione - + Unindent Rimuovi tabulazione - + Go To Line - + Find Previous Trova precedente - + Find Next Trova successivo - + Stop - + Debug - + Send Feedback - + Do you really want to exit? All unsaved changes will be lost. - + Turing - {file} (unsaved) - + Turing - {file} Turing - {file} - + Turing - New File - + Input: - + end of output - + end of output [{time}] - + Breakpoint: - + program interrupted - + Syntax error ({type}) at line {line}, offset {off}: - + Save output - + Text files (*.txt) - + Do you really want to create a new file? All unsaved changes will be lost. - + Advanced - + Zoom Zoom - + Folding - + Collapse - + Expand - + Collapse all - + Expand all - + Select word - + Select extended word - + Matched select - + Select line - + Select - + Regex Espressione regolare - + Match case - L'evidenziazione è case-sensitive + L'evidenziazione è case-sensitive - + Whole words Identifica solo parole intere - + In Selection - + 0 matches - + Replace All - + {num} matches - + Program file (*.py *.tr *.alg) - + Python file (*.py) - + Turing program (*.tr) - + Algobox file (*.alg) - + A new version of Turing is available. Would you like to download it? - + A modified file has been automatically saved. Would you like to recover it? - + Edit theme - + Settings Impostazioni - + Use arrow notation - + ASSIGN variable - + Recent files Header File recenti - + Recent articles Header - + Recent files Menu File recenti - + Load recent articles - + Check for updates - + You are about to choose an example file from the `examples` directory. To guess what examples are, you can guess from the file names. - + You are not allowed to write to {}, please choose another file path. diff --git a/src/lang/zh-CN.ts b/src/lang/zh-CN.ts index c5e543b..fc6dbd6 100644 --- a/src/lang/zh-CN.ts +++ b/src/lang/zh-CN.ts @@ -4,26 +4,26 @@ AboutWindow - + About Turing 关于Turing - + Program - + License - + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Turing {version}</span></p> <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Release channel : </span>{channel} <br /><br />Free and open-source software to assist the learning of algorithms and programming. <br /><br /><span style=" font-weight:600;">Copyright (c) 2018 the Turing development team (Léo Joly, Tom Niget)</span></p> <ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">This software is distributed under the terms of the MIT license and makes use of the <a href="https://www.qt.io/"><span style=" text-decoration: underline; color:#0000ff;">Qt</span></a> / <a href="https://riverbankcomputing.com/software/pyqt/"><span style=" text-decoration: underline; color:#0000ff;">pyQt</span></a>. frameworks.</li> @@ -39,97 +39,97 @@ p, li { white-space: pre-wrap; } Algo - + [k]BREAK[/k] - + [k]CONTINUE[/k] - + [b]ELSE[/b] - + [b]WHILE[/b] [c]{cond}[/c] - + [b]IF[/b] [c]{cond}[/c] - + [k]DECLARE[/k] [c]{var}[/c] - + [k]CALL[/k] [c]{code}[/c] - + [b]FOR[/b] [c]{var}[/c] [b]FROM[/b] [c]{begin}[/c] [b]TO[/b] [c]{end}[/c] {step} - + ([b]STEP[/b] [c]{step}[/c]) - + [b]FUNCTION[/b] [c]{func}({args})[/c] - + [k]RETURN[/k] [c]{val}[/c] - + [k]STOP[/k] [c]{val}[/c] - + [k]WAIT[/k] [c]{val}[/c] [k]SECONDS[/k] - + [k]CLEAR PLOT[/k] - + [k]DRAW LINE[/k] [c]{color}[/c] [k]FROM[/k] ([c]{start_x}[/c]; [c]{start_y}[/c]) [k]TO[/k] ([c]{end_x}[/c]; [c]{end_y}[/c]) - + [k]DRAW POINT[/k] [c]{color}[/c] [k]AT[/k] ([c]{x}[/c]; [c]{y}[/c]) - + [k]PLOT FUNCTION[/k] [c]{color}[/c] [i]f[/i]({var}) = [c]{expr}[/c] [k]FROM[/k] [c]{begin}[/c] [k]TO[/k] [c]{end}[/c] [k]STEP[/k] [c]{step}[/c] - + [b]PROGRAM[/b] - + [i]empty[/i] @@ -201,27 +201,27 @@ p, li { white-space: pre-wrap; } - + [k]SET WINDOW[/k] [i]Xmin=[/i][c]{x_min}[/c] [i]Xmax=[/i][c]{x_max}[/c] [i]Ymin=[/i][c]{y_min}[/c] [i]Ymax=[/i][c]{y_max}[/c] [i]Xgrad=[/i][c]{x_grad}[/c] [i]Ygrad=[/i][c]{y_grad}[/c] - + [k]VARIABLE[/k] [c]{var}[/c] [k]TAKES VALUE[/k] [c]{value}[/c] - + [k]DISPLAY[/k] [c]{val}[/c] {newline} - + [k]INPUT[/k] [c]{prompt}[/c] [k]TO[/k] [c]{var}[/c] {text} - + [c]{var}[/c] [k]&#129128;[/k] [c]{value}[/c] @@ -659,9 +659,6 @@ p, li { white-space: pre-wrap; } - - Algobox - CalcWindow @@ -1581,7 +1578,7 @@ Window Text : and - + @@ -1642,668 +1639,668 @@ Window Text : Expression editor - 表达式编辑器 + MainWindow - + Home - + Pseudocode - + Duplicate Line shorter - + Delete Line - + Edit Line - + Zoom in 放大 - + Zoom out 缩小 - + Reset zoom 恢复默认缩放 - + Basic - + Breakpoint - + Read user INPUT - + DISPLAY value - + Comment 注释/取消注释 - + Wait - + Blocks - + WHILE loop - + ELSE block - + FOR loop - + IF block - + CONTINUE - + BREAK - + Functions - + CALL function - + Define FUNCTION - + RETURN - + Plot - + Set window - + Clear plot - + Draw point - + Draw line - + Plot function - + Code - + &File 文件(&F) - + &Edit 编辑(&E) - + &Help - 帮助(&H) + - + &View 视图(&V) - + Change theme - + Change style - + &Program - + &Tools 工具(&O) - + Toolbar - + Output - + Clear Output - + Save Output - + Print Output - + New 新建 - + Open 打开 - + Save 保存 - + Save As 另存为 - + Exit 退出 - + Save All 全部保存 - + Undo 撤消 - + Redo 恢复 - + Cut 剪切 - + Copy 复制 - + Paste 粘贴 - + Quick Start - 快速入门 + - + Help Contents 帮助目录 - + About Turing 关于Turing - + Show toolbar - 显示工具栏 + - + Examples - + Print 打印 - + Find 查找 - + Replace 替换 - + Calculator 计算器 - + Clear - + Select All 全选 - + Run 运行 - + Step-by-step - + Show toolbar text - + Convert to Python - + Convert to pseudocode - + Duplicate Line - + Indent 插入制表符 - + Unindent 删除制表符 - + Go To Line - + Find Previous 查找上一个 - + Find Next 查找下一个 - + Stop - + Debug - + Send Feedback - + Do you really want to exit? All unsaved changes will be lost. - + Turing - {file} (unsaved) - + Turing - {file} Turing - {file} - + Turing - New File - + Input: - + end of output - + end of output [{time}] - + Breakpoint: - + program interrupted - + Syntax error ({type}) at line {line}, offset {off}: - + Save output - + Text files (*.txt) - + Do you really want to create a new file? All unsaved changes will be lost. - + Advanced - + Folding - + Collapse - + Expand - + Collapse all - + Expand all - + Select word - + Select extended word - + Matched select - + Select line - + Select - + Regex 正则表达式 - + Match case 区分大小写 - + Whole words 仅匹配完整词 - + In Selection - + 0 matches 0次匹配 - + Replace All - + {num} matches {num}次匹配 - + Program file (*.py *.tr *.alg) - + Python file (*.py) - + Turing program (*.tr) - + Algobox file (*.alg) - + A new version of Turing is available. Would you like to download it? - + A modified file has been automatically saved. Would you like to recover it? - + Zoom 缩放 - + Edit theme - + Settings - + Use arrow notation - + ASSIGN variable - + Recent files Header 近期文件 - + Recent articles Header - + Recent files Menu 近期文件 - + Load recent articles - + Check for updates - + You are about to choose an example file from the `examples` directory. To guess what examples are, you can guess from the file names. - + You are not allowed to write to {}, please choose another file path. diff --git a/src/maths/nodes/ArrayAccessNode.py b/src/maths/nodes/ArrayAccessNode.py index 61f6fd2..7d8cd99 100644 --- a/src/maths/nodes/ArrayAccessNode.py +++ b/src/maths/nodes/ArrayAccessNode.py @@ -26,7 +26,7 @@ def code(self, bb=False) -> str: self.array.code_fix(bb), self.index.code(bb)) def python(self) -> str: - return "%s[%s]" % (protectExpr(self.array.python()), self.index.python()) + return "(%s)[%s]" % (self.array.python(), self.index.python()) def children(self) -> List["AstNode"]: return [self.array, self.index] diff --git a/src/maths/nodes/AstNode.py b/src/maths/nodes/AstNode.py index 0702f00..fd6a18c 100644 --- a/src/maths/nodes/AstNode.py +++ b/src/maths/nodes/AstNode.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- -from shlex import shlex # lexer module for shell-mode expressions from typing import List - +from shlex import shlex # lexer module for shell-mode expressions class AstNode: """Base node class""" @@ -26,7 +25,6 @@ def children(self) -> List["AstNode"]: def flatten(self) -> List["AstNode"]: return [self] + self.children() - def isSimple(s): """ @ param s a string which may be a left or a right operand @@ -34,11 +32,10 @@ def isSimple(s): when it is enclosed in parentheses or when it contains a single toke, according to shlex """ - return len(list(shlex(s))) == 1 or \ - (s[0] == '(' and s[-1] == ')') or \ - (s[0] == '{' and s[-1] == '}') or \ - (s[0] == '[' and s[-1] == ']') - + return len(list(shlex(s)))==1 or \ + (s[0]=='(' and s[-1]==')') or \ + (s[0]=='{' and s[-1]=='}') or \ + (s[0]=='[' and s[-1]==']') def protectExpr(s): """ @@ -47,4 +44,5 @@ def protectExpr(s): """ if isSimple(s): return s - return '(' + s + ')' + return '('+s+')' + diff --git a/src/maths/nodes/BinOpNode.py b/src/maths/nodes/BinOpNode.py index ed34d37..7f03059 100644 --- a/src/maths/nodes/BinOpNode.py +++ b/src/maths/nodes/BinOpNode.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- import maths.parser import util.html -from .AstNode import * from .IdentifierNode import * from .NumberNode import * +from .AstNode import * from .StringNode import StringNode @@ -86,8 +86,8 @@ def python(self) -> str: elif type(right) == StringNode and type(left) != StringNode: left_py = "str(%s)" % left_py - return "%s %s %s" % \ - (protectExpr(left_py), op_fix, protectExpr(right_py)) + return "(%s %s %s)" % \ + (protectExpr(left_py), op_fix, protectExpr(right_py)) def children(self) -> List["AstNode"]: return [self.left, self.right] diff --git a/src/maths/nodes/StringNode.py b/src/maths/nodes/StringNode.py index 5c10886..34b7557 100644 --- a/src/maths/nodes/StringNode.py +++ b/src/maths/nodes/StringNode.py @@ -25,4 +25,4 @@ def code(self, bb=False) -> str: return '"%s"' % repr(self.value)[1:-1] def python(self) -> str: - return "%r" % self.value + return "%r" % protectExpr(self.value) diff --git a/src/maths/parser.py b/src/maths/parser.py index 5ba6999..c2fccb6 100644 --- a/src/maths/parser.py +++ b/src/maths/parser.py @@ -538,7 +538,7 @@ def beautify(self): prev1 = (typ, val) # remove double whitespaces - return re.sub("\s\s+", " ", result) + return re.sub(r"\s\s+", " ", result) def quick_parse(expr: str) -> nodes.AstNode: diff --git a/src/project.pro b/src/project.pro index 7a3bc67..43771d4 100644 --- a/src/project.pro +++ b/src/project.pro @@ -7,157 +7,156 @@ RESOURCES += \ turing.qrc SOURCES += \ - turing_rc.py \ editor_backend.py \ main.py \ - algo\__tests__.py \ + turing_rc.py \ algo\worker.py \ algo\__init__.py \ + algo\__tests__.py \ algo\backends\texas.py \ algo\backends\__init__.py \ - algo\stmts\FuncStmt.py \ + algo\frontends\algobox.py \ + algo\frontends\__init__.py \ algo\stmts\AssignStmt.py \ - algo\stmts\GPointStmt.py \ + algo\stmts\BaseStmt.py \ + algo\stmts\BlockStmt.py \ + algo\stmts\BreakStmt.py \ + algo\stmts\CallStmt.py \ + algo\stmts\CommentStmt.py \ + algo\stmts\ContinueStmt.py \ algo\stmts\DisplayStmt.py \ - algo\stmts\__init__.py \ algo\stmts\ElseStmt.py \ - algo\stmts\CallStmt.py \ - algo\stmts\BlockStmt.py \ - algo\stmts\InputStmt.py \ + algo\stmts\ForStmt.py \ + algo\stmts\FuncStmt.py \ algo\stmts\GClearStmt.py \ + algo\stmts\GFuncStmt.py \ algo\stmts\GLineStmt.py \ - algo\stmts\ContinueStmt.py \ - algo\stmts\ForStmt.py \ - algo\stmts\BaseStmt.py \ - algo\stmts\SleepStmt.py \ + algo\stmts\GPointStmt.py \ algo\stmts\GWindowStmt.py \ algo\stmts\IfStmt.py \ + algo\stmts\InputStmt.py \ + algo\stmts\ReturnStmt.py \ + algo\stmts\SleepStmt.py \ algo\stmts\StopStmt.py \ algo\stmts\WhileStmt.py \ - algo\stmts\BreakStmt.py \ - algo\stmts\ReturnStmt.py \ - algo\stmts\CommentStmt.py \ - algo\stmts\GFuncStmt.py \ - algo\frontends\algobox.py \ - algo\frontends\__init__.py \ - forms\ui_alg_sleep.py \ - forms\alg_func.py \ + algo\stmts\__init__.py \ + forms\about.py \ + forms\alg_call.py \ + forms\alg_comment.py \ forms\alg_define.py \ - forms\alg_gline.py \ - forms\calculator.py \ - forms\ui_inline_code.py \ - forms\ui_alg_comment.py \ - forms\ui_alg_gline.py \ - forms\__init__.py \ - forms\ui_alg_for.py \ + forms\alg_display.py \ forms\alg_for.py \ + forms\alg_func.py \ + forms\alg_gfunc.py \ + forms\alg_gline.py \ + forms\alg_gpoint.py \ + forms\alg_gwindow.py \ + forms\alg_if.py \ + forms\alg_input.py \ + forms\alg_return.py \ forms\alg_sleep.py \ - forms\ui_alg_call.py \ - forms\w_inline_code.py \ - forms\ui_alg_return.py \ - forms\inline_code_dialog.py \ forms\alg_stop.py \ - forms\alg_comment.py \ - forms\alg_gpoint.py \ + forms\alg_while.py \ + forms\calculator.py \ forms\changtheme.py \ + forms\help.py \ + forms\inline_code_dialog.py \ + forms\inline_code_editor.py \ forms\mainwindow.py \ - forms\alg_while.py \ forms\ui_about.py \ - forms\ui_mainwindow.py \ - forms\alg_gwindow.py \ + forms\ui_alg_call.py \ + forms\ui_alg_comment.py \ + forms\ui_alg_define.py \ + forms\ui_alg_display.py \ + forms\ui_alg_for.py \ + forms\ui_alg_func.py \ + forms\ui_alg_gfunc.py \ + forms\ui_alg_gline.py \ forms\ui_alg_gpoint.py \ - forms\ui_changtheme.py \ - forms\ui_alg_input.py \ forms\ui_alg_gwindow.py \ - forms\ui_alg_gfunc.py \ - forms\ui_alg_func.py \ - forms\alg_return.py \ - forms\about.py \ forms\ui_alg_if.py \ - forms\ui_calculator.py \ - forms\ui_alg_display.py \ - forms\inline_code_editor.py \ - forms\alg_if.py \ + forms\ui_alg_input.py \ + forms\ui_alg_return.py \ + forms\ui_alg_sleep.py \ forms\ui_alg_stop.py \ forms\ui_alg_while.py \ - forms\alg_display.py \ - forms\alg_call.py \ + forms\ui_calculator.py \ + forms\ui_changtheme.py \ forms\ui_help.py \ - forms\alg_input.py \ - forms\ui_alg_define.py \ - forms\alg_gfunc.py \ - forms\help.py \ + forms\ui_inline_code.py \ + forms\ui_mainwindow.py \ + forms\w_inline_code.py \ + forms\__init__.py \ + lang\translator.py \ + lang\__init__.py \ maths\evaluator.py \ maths\parser.py \ maths\__init__.py \ maths\__tests__.py \ - maths\nodes\UnaryOpNode.py \ - maths\nodes\NumberNode.py \ - maths\nodes\ListNode.py \ - maths\nodes\ArrayAccessNode.py \ - maths\nodes\IdentifierNode.py \ - maths\nodes\LambdaNode.py \ - maths\nodes\BinOpNode.py \ - maths\nodes\AstNode.py \ - maths\nodes\__init__.py \ - maths\nodes\StringNode.py \ - maths\nodes\CallNode.py \ - maths\lib\stats.py \ - maths\lib\geom.py \ - maths\lib\const.py \ maths\lib\algobox.py \ - maths\lib\physics.py \ + maths\lib\basic.py \ maths\lib\cast.py \ + maths\lib\const.py \ maths\lib\docs.py \ - maths\lib\basic.py \ + maths\lib\geom.py \ + maths\lib\physics.py \ + maths\lib\stats.py \ maths\lib\trig.py \ maths\lib\__init__.py \ - tools\docgen.py \ + maths\nodes\ArrayAccessNode.py \ + maths\nodes\AstNode.py \ + maths\nodes\BinOpNode.py \ + maths\nodes\CallNode.py \ + maths\nodes\IdentifierNode.py \ + maths\nodes\LambdaNode.py \ + maths\nodes\ListNode.py \ + maths\nodes\NumberNode.py \ + maths\nodes\StringNode.py \ + maths\nodes\UnaryOpNode.py \ + maths\nodes\__init__.py \ + tests\chat.py \ + tests\framework.py \ + tests\__init__.py \ tools\build.py \ + tools\docgen.py \ tools\progen.py \ - util\log.py \ util\code.py \ - util\widgets.py \ - util\undoredo.py \ - util\theming.py \ - util\math.py \ - util\profiler.py \ util\html.py \ - util\__init__.py \ - lang\__init__.py \ - lang\translator.py \ - tests\framework.py \ - tests\chat.py \ - tests\__init__.py + util\log.py \ + util\math.py \ + util\theming.py \ + util\undoredo.py \ + util\widgets.py \ + util\__init__.py FORMS += \ - forms\ui_help.ui \ + forms\ui_about.ui \ + forms\ui_alg_call.ui \ + forms\ui_alg_comment.ui \ forms\ui_alg_define.ui \ - forms\ui_calculator.ui \ - forms\ui_alg_if.ui \ - forms\ui_alg_while.ui \ forms\ui_alg_display.ui \ - forms\ui_alg_stop.ui \ - forms\ui_alg_input.ui \ - forms\ui_alg_gwindow.ui \ - forms\ui_alg_gfunc.ui \ + forms\ui_alg_for.ui \ forms\ui_alg_func.ui \ - forms\ui_about.ui \ - forms\ui_alg_gpoint.ui \ - forms\ui_changtheme.ui \ - forms\ui_mainwindow.ui \ - forms\ui_alg_comment.ui \ + forms\ui_alg_gfunc.ui \ forms\ui_alg_gline.ui \ - forms\ui_alg_call.ui \ - forms\w_inline_code.ui \ + forms\ui_alg_gpoint.ui \ + forms\ui_alg_gwindow.ui \ + forms\ui_alg_if.ui \ + forms\ui_alg_input.ui \ forms\ui_alg_return.ui \ - forms\ui_alg_for.ui \ + forms\ui_alg_sleep.ui \ + forms\ui_alg_stop.ui \ + forms\ui_alg_while.ui \ + forms\ui_calculator.ui \ + forms\ui_changtheme.ui \ + forms\ui_help.ui \ forms\ui_inline_code.ui \ - forms\ui_alg_sleep.ui + forms\ui_mainwindow.ui \ + forms\w_inline_code.ui TRANSLATIONS += \ - lang\it.ts \ - lang\fr.ts \ - lang\zh-CN.ts \ lang\de.ts \ - lang\es.ts \ No newline at end of file + lang\es.ts \ + lang\fr.ts \ + lang\it.ts \ + lang\zh-CN.ts \ No newline at end of file diff --git a/src/tools/docgen.py b/src/tools/docgen.py index 8d4cd43..a8ad834 100644 --- a/src/tools/docgen.py +++ b/src/tools/docgen.py @@ -50,8 +50,8 @@ def doc_funcs(): args += "" # replace {{x}} by `x` for markdown - desc = re.sub(r"{{(\w+)\}\}", "`\g<1>`", function[2]) - desc = re.sub(r"//(\w+)//", "*\g<1>*", desc) + desc = re.sub(r"{{(\w+)\}\}", r"`\g<1>`", function[2]) + desc = re.sub(r"//(\w+)//", r"*\g<1>*", desc) result += "|%s|%s|%s|\n" % (name, args, desc) @@ -91,7 +91,7 @@ def doc_consts(): # add unit unit = " (%s)" % constant[3].replace("*", "·") - desc = re.sub(r"//(\w+)//", "*\g<1>*", desc) + desc = re.sub(r"//(\w+)//", r"*\g<1>*", desc) result += "|`%s`|%s|*%s* - %s%s|\n" % (name, value, symbol, desc, unit)