The debug module#
This module provides a debug window to show/edit text and the tokenized tree.
Use:
$ python3 -m parceqt.debug <filename>
You can also create a debug window in an interactive session; see the class documentation.
The debug window shows highlighted text, and the tokenized tree structure.
- class DebugWindow(parent=None)[source]#
Bases:
QMainWindowA main window to edit text and examine the generated token structure.
Example:
from PyQt5.Qt import * a=QApplication([]) from parceqt.debug import DebugWindow w = DebugWindow() w.resize(1200,900) w.show() w.set_theme("default", True) from parce.lang.css import * w.set_root_lexicon(Css.root) w.set_text(open("path/to/parce/themes/default.css").read())
In the debug window you can edit the text at the left and directly at the right examine the tree structure. Along the top of the window the path to the token at the current cursor position is displayed, from the root lexicon upto the token, from which the action is displayed.
Clicking a button selects the associated range of the context or token in the text view. Clicking an item in the tree also selects that range in the text.
Moving the cursor in the text updates the current item in the tree, and the displayed ancestor path.
- show_updated_region_enabled = False#
- class LexiconChooser(parent=None, registry=None)[source]#
Bases:
LexiconChooser
- class AncestorView(parent=None)[source]#
Bases:
QWidgetDisplays a horizontal row of buttons for a token.
- node_clicked#
Qt signal, emitted when a node is clicked.
- class Actions(mainwindow)[source]#
Bases:
objectContainer for all the QActions and their implementations.
Populate a menu bar.