robotkernel
Advanced tools
| <aside class="navbar-demo-box" title="try RobotKernel in your browser right now."> | ||
| <h2>DEMO</h2> | ||
| <div class="demo-label"> | ||
| Try <code>RobotKernel</code> right now with <em><input | ||
| id="room-name" | ||
| type="text" | ||
| placeholder="nobody else" | ||
| title="give a room name to enable shared editing with videochat" | ||
| /> in...</em> | ||
| </div> | ||
| <form | ||
| action="{{ pathto('_/lab/index.html?path=Example.ipynb', 1) }}" | ||
| target="_blank" | ||
| class="demo" | ||
| > | ||
| <input | ||
| type="submit" | ||
| title="RobotKernel in the la[te]st Jupyter UI" | ||
| value="JupyterLab" | ||
| class="launch-demo" | ||
| /> | ||
| <input name="path" type="hidden" value="Example.ipynb" /> | ||
| <input name="room" type="hidden" value="" /> | ||
| <input name="JVC-PUBLIC" type="hidden" value="" /> | ||
| </form> | ||
| <div class="demo-label"> | ||
| ... with <a href="https://github.com/jupyterlite/jupyterlite">JupyterLite</a> | ||
| </div> | ||
| </aside> | ||
| <script> | ||
| $(function () { | ||
| const roomName = $("#room-name"); | ||
| roomName.on("input", () => { | ||
| $("input[name='room']").prop("value", roomName.prop("value")); | ||
| $("input[name='JVC-PUBLIC']").prop("value", roomName.prop("value")); | ||
| }); | ||
| }); | ||
| </script> | ||
| <style> | ||
| :root { | ||
| --pg-brand-color0: #000; | ||
| --pg-layout-color0: #fff; | ||
| --pg-box-shadow0: 0.25em 0.25em #ccc; | ||
| --pst-color-link: 252, 4, 4; | ||
| --pst-color-inline-code: 67, 67, 200; | ||
| } | ||
| .navbar-demo-box h2 { | ||
| margin: 0; | ||
| padding: 0; | ||
| color: var(--pg-layout-color0); | ||
| text-align: center; | ||
| width: 100%; | ||
| font-style: italic; | ||
| } | ||
| /* card style */ | ||
| .right-next, | ||
| .left-prev, | ||
| .navbar-demo-box { | ||
| background-color: var(--pg-brand-color0); | ||
| color: var(--pg-layout-color0); | ||
| box-shadow: var(--pg-box-shadow0); | ||
| margin-bottom: 1em; | ||
| } | ||
| .prev-next-subtitle { | ||
| font-style: italic; | ||
| } | ||
| .navbar-demo-box { | ||
| display: flex; | ||
| flex-direction: row; | ||
| flex-wrap: wrap; | ||
| border-left: 0; | ||
| border-right: 0; | ||
| padding: 1em 0 0 0; | ||
| margin-bottom: 1em; | ||
| padding: 0.5em; | ||
| text-align: center; | ||
| } | ||
| .prev-next-area a p.prev-next-title, | ||
| .right-next p, .left-prev p { | ||
| color: var(--pg-layout-color0); | ||
| } | ||
| .navbar-demo-box code, | ||
| .right-next code, | ||
| .left-prev code { | ||
| color: var(--pg-brand-color0); | ||
| background-color: var(--pg-layout-color0); | ||
| padding: 0.25em; | ||
| font-weight: bold; | ||
| } | ||
| main.bd-content #main-content .right-next, | ||
| main.bd-content #main-content .left-prev, | ||
| .navbar-demo-box a { | ||
| color: var(--pg-layout-color0); | ||
| font-weight: bold; | ||
| } | ||
| .navbar-demo-box > .demo-label { | ||
| flex: 1; | ||
| width: 100%; | ||
| min-width: 100%; | ||
| } | ||
| #room-name { | ||
| margin-left: 0.5em; | ||
| display: inline-box; | ||
| max-width: 6em; | ||
| border: 0; | ||
| border-bottom: dotted 2px var(--pg-layout-color0); | ||
| background-color: transparent; | ||
| color: var(--pg-layout-color0); | ||
| text-align: center; | ||
| font-weight: bold; | ||
| } | ||
| #room-name::placeholder{ | ||
| font-style: italic; | ||
| color: var(--pg-layout-color0); | ||
| font-weight: 400; | ||
| } | ||
| .demo { | ||
| flex: 1; | ||
| display: flex; | ||
| } | ||
| .launch-demo { | ||
| color: var(--pg-brand-color0); | ||
| background-color: var(--pg-layout-color0); | ||
| padding: 0.5em; | ||
| width: 100%; | ||
| margin: 0.5em 0; | ||
| display: block; | ||
| font-size: 150%; | ||
| font-weight: bold; | ||
| font-style: italic; | ||
| text-align: center; | ||
| border: 0; | ||
| } | ||
| .launch-demo:hover, | ||
| .launch-demo:active, | ||
| .launch-demo:focus { | ||
| text-decoration: underline; | ||
| } | ||
| </style> |
| {% if theme_navbar_footer_text %}{% set theme_extra_navbar=theme_navbar_footer_text %}{% endif %} <!-- To handle the deprecated key --> | ||
| {% if theme_extra_navbar %} | ||
| <div class="navbar_extra_footer"> | ||
| {{ theme_extra_navbar }} | ||
| </div> | ||
| {% endif %} |
| <nav class="bd-links" id="bd-docs-nav" aria-label="Main"> | ||
| <div class="bd-toc-item active"> | ||
| {{ sbt_generate_nav_html(include_item_names=True, | ||
| with_home_page=theme_home_page_in_toc, show_depth=theme_show_navbar_depth) | ||
| }} | ||
| </div> | ||
| </nav> | ||
| {% include "lite-demo.html" %} |
| <div class="navbar-brand-box"> | ||
| <a class="navbar-brand text-wrap" href="{{ pathto('index') }}"> | ||
| {% if logo %} | ||
| <!-- `logo` is deprecated in Sphinx 4.0, so remove this when we stop supporting 3 --> | ||
| {% set logo_url=logo %} {% endif %} {% if logo_url %} | ||
| <img src="{{ pathto('_static/' + logo_url, 1) }}" class="logo" alt="logo" /> | ||
| {% endif %} {% if docstitle and not theme_logo_only %} | ||
| <h1 class="site-logo" id="site-title">{{ docstitle }}</h1> | ||
| {% endif %} | ||
| </a> | ||
| </div> |
+4
| format: jb-book | ||
| root: docs/index.rst | ||
| chapters: | ||
| - file: docs/install.rst |
| version: 2 | ||
| build: | ||
| os: "ubuntu-20.04" | ||
| tools: | ||
| python: "mambaforge-4.10" | ||
| conda: | ||
| environment: docs/environment.yml | ||
| sphinx: | ||
| configuration: conf.py |
| channels: | ||
| - conda-forge | ||
| - nodefaults | ||
| dependencies: | ||
| # docs | ||
| - jupyter-book | ||
| - black | ||
| - sphinx-autoapi | ||
| # apps (for labextension version compatibility) | ||
| - jupyterlab >=3.2,<4 | ||
| # pretties | ||
| - ipylab | ||
| - ipywidgets | ||
| - jupyterlab-fonts | ||
| - jupyter-videochat | ||
| - wxyz_lab | ||
| # dev stuff | ||
| - pip | ||
| - doit | ||
| - pkginfo | ||
| - nodejs >=14,<15 | ||
| - setuptools_scm >=6.2 | ||
| # I'm still afraid of jlpm | ||
| - yarn | ||
| - pip: | ||
| # lite deps | ||
| - jupyterlite[all] ==0.1.0b4 | ||
| - ../lite/jupyterlite-robotkernel |
+11
-1
| syntax: glob | ||
| *.egg-info | ||
| *.pyc | ||
| *.doit.db | ||
| *.log | ||
| *.tsbuildinfo | ||
| _/ | ||
| _pypi.ts | ||
| lib/ | ||
| pypi/ | ||
| dist/ | ||
| labextension/ | ||
| node_modules/ | ||
| .cache | ||
| .eggs | ||
| .DS_Store | ||
@@ -25,2 +36,1 @@ .idea | ||
| /Untitle*.ipynb | ||
+7
-7
| Changelog | ||
| ========= | ||
| 1.6a2 (2022-03-09) | ||
| ------------------ | ||
| 1.6rc1 (2022-04-07) | ||
| ------------------- | ||
| - Fix support for ipywidgets >= 8.0.0rc0 | ||
| [datakurre] | ||
| - Update classic Notebook mode with Robot Framework 5 features | ||
| [bollwyvl, datakurre] | ||
| - Add pyolite support | ||
| [datakurre] | ||
| 1.6.0a1 (2022-02-22) | ||
| -------------------- | ||
| - Add %sticky magic LibraryName -magic to preserve state of global and suite scope libraries between executions | ||
| - Add %sticky magic LibraryName -magic to optionally preserve state of global and suite scope libraries between executions | ||
| [datakurre] | ||
@@ -15,0 +15,0 @@ |
+9
-4
| graft src/robotkernel | ||
| graft pkgs | ||
| graft docs | ||
| graft tests | ||
| graft atest | ||
| recursive-include src *.js | ||
| include LICENSE *.rst *.nix | ||
| exclude Makefile Dockerfile requirements*.txt *.ipynb *.json | ||
| prune nix | ||
| include LICENSE *.rstj | ||
| exclude Makefile Dockerfile requirements*.txt *.nix *.png *.ipynb *.json dodo.py conf.py | ||
| prune .github | ||
| prune binder | ||
| prune examples | ||
| prune lite | ||
| prune nix | ||
| prune pkgs | ||
| prune src/jupyterlab_robotmode | ||
| global-exclude *.py[co] |
+8
-8
| Metadata-Version: 2.1 | ||
| Name: robotkernel | ||
| Version: 1.6a2 | ||
| Version: 1.6rc1 | ||
| Summary: A Jupyter kernel for interactive acceptance-test-driven development with the Robot Framework | ||
@@ -193,12 +193,12 @@ Home-page: https://github.com/robots-from-jupyter/robotkernel | ||
| 1.6a2 (2022-03-09) | ||
| ------------------ | ||
| 1.6rc1 (2022-04-07) | ||
| ------------------- | ||
| - Fix support for ipywidgets >= 8.0.0rc0 | ||
| [datakurre] | ||
| - Update classic Notebook mode with Robot Framework 5 features | ||
| [bollwyvl, datakurre] | ||
| - Add pyolite support | ||
| [datakurre] | ||
| 1.6.0a1 (2022-02-22) | ||
| -------------------- | ||
| - Add %sticky magic LibraryName -magic to preserve state of global and suite scope libraries between executions | ||
| - Add %sticky magic LibraryName -magic to optionally preserve state of global and suite scope libraries between executions | ||
| [datakurre] | ||
@@ -205,0 +205,0 @@ |
+1
-1
| [metadata] | ||
| name = robotkernel | ||
| version = 1.6a2 | ||
| version = 1.6rc1 | ||
| description = A Jupyter kernel for interactive acceptance-test-driven development with the Robot Framework | ||
@@ -5,0 +5,0 @@ long_description = file: README.rst, CHANGELOG.rst |
| Metadata-Version: 2.1 | ||
| Name: robotkernel | ||
| Version: 1.6a2 | ||
| Version: 1.6rc1 | ||
| Summary: A Jupyter kernel for interactive acceptance-test-driven development with the Robot Framework | ||
@@ -193,12 +193,12 @@ Home-page: https://github.com/robots-from-jupyter/robotkernel | ||
| 1.6a2 (2022-03-09) | ||
| ------------------ | ||
| 1.6rc1 (2022-04-07) | ||
| ------------------- | ||
| - Fix support for ipywidgets >= 8.0.0rc0 | ||
| [datakurre] | ||
| - Update classic Notebook mode with Robot Framework 5 features | ||
| [bollwyvl, datakurre] | ||
| - Add pyolite support | ||
| [datakurre] | ||
| 1.6.0a1 (2022-02-22) | ||
| -------------------- | ||
| - Add %sticky magic LibraryName -magic to preserve state of global and suite scope libraries between executions | ||
| - Add %sticky magic LibraryName -magic to optionally preserve state of global and suite scope libraries between executions | ||
| [datakurre] | ||
@@ -205,0 +205,0 @@ |
| .gitignore | ||
| .readthedocs.yml | ||
| CHANGELOG.rst | ||
@@ -6,15 +7,12 @@ LICENSE | ||
| README.rst | ||
| default.nix | ||
| requirements-python39-rf31.nix | ||
| requirements-python39-rf32.nix | ||
| requirements-python39-rf40.nix | ||
| requirements-python39-rf41.nix | ||
| requirements-python39-rf50.nix | ||
| _toc.yml | ||
| setup.cfg | ||
| setup.nix | ||
| setup.py | ||
| shell.nix | ||
| .github/workflows/smoketest.yml | ||
| _templates/lite-demo.html | ||
| _templates/sbt-sidebar-footer.html | ||
| _templates/sbt-sidebar-nav.html | ||
| _templates/sidebar-logo.html | ||
| atest/Test Robot Notebook.ipynb | ||
| docs/conf.py | ||
| docs/environment.yml | ||
| docs/index.rst | ||
@@ -57,5 +55,2 @@ docs/install.rst | ||
| docs/robocon2020/starters-02.png | ||
| pkgs/sikulix/default.nix | ||
| pkgs/sikulixlibrary/default.nix | ||
| pkgs/sikulixlibrary/stop_remote_server.patch | ||
| src/robotkernel/__init__.py | ||
@@ -62,0 +57,0 @@ src/robotkernel/builders.py |
@@ -156,3 +156,3 @@ # -*- coding: utf-8 -*- | ||
| # noinspection PyTypeChecker | ||
| display(ui, out, display_id=display_id) | ||
| display(ipywidgets.widgets.VBox([ui, out]), display_id=display_id) | ||
@@ -159,0 +159,0 @@ |
@@ -228,14 +228,7 @@ (function() { | ||
| /* | ||
| An implementation of syntax highlighting for robot framework 3.1. | ||
| http://robotframework.org/robotframework/3.1/RobotFrameworkUserGuide.html | ||
| When necessary, the source code is consulted and ultimately trusted: | ||
| https://github.com/robotframework/robotframework | ||
| Copyright (c) 2022 MarketSquare | ||
| Distributed under the terms of the BSD-3-Clause License | ||
| */ | ||
| // tslint:disable-next-line | ||
| /// <reference path="../typings/codemirror/codemirror.d.ts"/> | ||
| /** the tokens we use */ | ||
| var TT = {}; | ||
| var TT; | ||
| (function (TT) { | ||
@@ -264,29 +257,26 @@ TT["AM"] = "atom"; | ||
| TT["V2"] = "variable-2"; | ||
| })(TT); | ||
| function LINK(token) { | ||
| return (token + '.link'); | ||
| } | ||
| })(TT || (TT = {})); | ||
| /** helper function for compactly representing a rule */ | ||
| function r(regex, token, opt) { | ||
| return __assign({ regex: regex, token: token }, opt); | ||
| return { regex, token, ...opt }; | ||
| } | ||
| /** Possible Robot Framework table names. Group count is important. */ | ||
| var TABLE_NAMES = { | ||
| const TABLE_NAMES = { | ||
| keywords: /(\|\s)?(\*+ *)(user keywords?|keywords?)( *\**)/i, | ||
| settings: /(\|\s)?(\*+ *)(settings?)( *\**)/i, | ||
| test_cases: /(\|\s)?(\*+ *)(tasks?|test cases?)( *\**)/i, | ||
| variables: /(\|\s)?(\*+ *)(variables?)( *\**)/i | ||
| variables: /(\|\s)?(\*+ *)(variables?)( *\**)/i, | ||
| }; | ||
| /** Enumerate the possible rules */ | ||
| var RULES_TABLE = Object.keys(TABLE_NAMES).map(function (next) { | ||
| const RULES_TABLE = Object.keys(TABLE_NAMES).map((next) => { | ||
| return r(TABLE_NAMES[next], [TT.BK, TT.HL, TT.HL, TT.HL], { | ||
| next: next, | ||
| sol: true | ||
| next, | ||
| sol: true, | ||
| }); | ||
| }); | ||
| var RULE_COMMENT_POP = r(/#.*$/, TT.CM, { pop: true }); | ||
| const RULE_COMMENT_POP = r(/#.*$/, TT.CM, { pop: true }); | ||
| /** Valid python operators */ | ||
| var VAR_OP = /[*\-+\\%&|=><!]/; | ||
| const VAR_OP = /[*\-+\\%&|=><!]/; | ||
| /** Valid python numbers */ | ||
| var VAR_NUM = /0(b[01]+|o[0-7]+|x[0-9a-f]+)|(\d+)(\.\d+)?(e-?(\d+)(\.\d+)?)?/i; | ||
| const VAR_NUM = /0(b[01]+|o[0-7]+|x[0-9a-f]+)|(\d+)(\.\d+)?(e-?(\d+)(\.\d+)?)?/i; | ||
| /** | ||
@@ -296,48 +286,49 @@ Valid python builtins | ||
| */ | ||
| var VAR_BUILTIN = /(none|(cur|temp|exec)dir|\/|:|\\n|true|empty|false|null|space|test (name|documentation|status|message|tags)|prev test (name|status|message)|suite (name|source|documentation|status|message|metadata)|keyword (status|message)|(report|debug) file|log (file|level)|output (dir|file))(?=[.}]|\s+[*\-+\\%&|=><!])/i; | ||
| const VAR_BUILTIN = /(none|(cur|temp|exec)dir|\/|:|\\n|true|empty|false|null|space|test (name|documentation|status|message|tags)|prev test (name|status|message)|suite (name|source|documentation|status|message|metadata)|keyword (status|message)|(report|debug) file|log (file|level)|output (dir|file))(?=[.}]|\s+[*\-+\\%&|=><!])/i; | ||
| /** a rule for the beginning of the variable state */ | ||
| var RULE_VAR_START = r(/[\$&@%]\{/, TT.V2, { push: 'variable' }); | ||
| const RULE_VAR_START = r(/[\$&@%]\{/, TT.V2, { push: 'variable' }); | ||
| /** a rule for the end of the variable state */ | ||
| var RULE_VAR_END = r(/\}/, TT.V2); | ||
| const RULE_VAR_END = r(/\}/, TT.V2); | ||
| /** a rule for a number */ | ||
| var RULE_NUM = r(VAR_NUM, TT.NB); | ||
| const RULE_NUM = r(VAR_NUM, TT.NB); | ||
| /** a rule for starting a single quote */ | ||
| var RULE_SINGLE_STRING_START = r(/'/, TT.ST, { push: 'single_string' }); | ||
| const RULE_SINGLE_STRING_START = r(/'/, TT.ST, { push: 'single_string' }); | ||
| /** a rule for starting a double quote */ | ||
| var RULE_DOUBLE_STRING_START = r(/"/, TT.ST, { push: 'double_string' }); | ||
| const RULE_DOUBLE_STRING_START = r(/"/, TT.ST, { push: 'double_string' }); | ||
| /** a rule for capturing tags (and friends) in keyword/test/task definitions */ | ||
| var RULE_TAGS = r(/([|\s]*\s*)(\[\s*)(tags)(\s*\])(\s*\|?)/i, [TT.BK, TT.MT, TT.MT, TT.MT, TT.BK], { sol: true, push: 'tags' }); | ||
| const RULE_TAGS = r(/([|\s]*\s*)(\[\s*)(tags)(\s*\])(\s*\|?)/i, [TT.BK, TT.MT, TT.MT, TT.MT, TT.BK], { sol: true, push: 'tags' }); | ||
| /** rule for special case of applying tags at the suite level */ | ||
| var RULE_SUITE_TAGS = r(/(force tags|default tags)(\t+| +)/i, [TT.MT, null], { | ||
| const RULE_SUITE_TAGS = r(/(force tags|default tags)(\t+| +)/i, [TT.MT, null], { | ||
| push: 'tags', | ||
| sol: true | ||
| sol: true, | ||
| }); | ||
| /** rule for special case of applying tags at the suite level (with pipes) */ | ||
| var RULE_SUITE_TAGS_PIPE = r(/(\| +)(force tags|default tags)( *\|?)/i, [TT.BK, TT.MT, TT.BK], { sol: true, push: 'tags' }); | ||
| const RULE_SUITE_TAGS_PIPE = r(/(\| +)(force tags|default tags)( *\|?)/i, [TT.BK, TT.MT, TT.BK], { sol: true, push: 'tags' }); | ||
| /** rule for bracketed settings of keyword/test/task */ | ||
| var RULE_SETTING_KEYWORD = r(/([|\s]*)(\[\s*)(setup|teardown|template)(\s*\])(\s*\|?)/i, [TT.BK, TT.MT, TT.MT, TT.MT, TT.BK], { push: 'keyword_invocation_no_continue', sol: true }); | ||
| const RULE_SETTING_KEYWORD = r(/([|\s]*)(\[\s*)(setup|teardown|template)(\s*\])(\s*\|?)/i, [TT.BK, TT.MT, TT.MT, TT.MT, TT.BK], { push: 'keyword_invocation_no_continue', sol: true }); | ||
| /** rule for bracketed settings of keyword/test/task that include a keyword */ | ||
| var RULE_SUITE_SETTING_KEYWORD = r(/(suite setup|suite teardown|test setup|test teardown|test template|task setup|task teardown|task template)(\t+| +)/i, [TT.MT, null], { push: 'keyword_invocation', sol: true }); | ||
| const RULE_SUITE_SETTING_KEYWORD = r(/(suite setup|suite teardown|test setup|test teardown|test template|task setup|task teardown|task template)(\t+| +)/i, [TT.MT, null], { push: 'keyword_invocation', sol: true }); | ||
| /** rule for bracketed settings of keyword/test/task that include a keyword (with pipes) */ | ||
| var RULE_SUITE_SETTING_KEYWORD_PIPE = r(/(\| +)(suite setup|suite teardown|test setup|test teardown|test template|task setup|task teardown|task template)( +\|)/i, [TT.BK, TT.MT, TT.BK], { push: 'keyword_invocation', sol: true }); | ||
| var RULE_SETTING_LIBRARY = r(/(library)(\t+| +)/i, [TT.MT, null], { | ||
| const RULE_SUITE_SETTING_KEYWORD_PIPE = r(/(\| +)(suite setup|suite teardown|test setup|test teardown|test template|task setup|task teardown|task template)( +\|)/i, [TT.BK, TT.MT, TT.BK], { push: 'keyword_invocation', sol: true }); | ||
| const RULE_SETTING_LIBRARY = r(/(library)(\t+| +)/i, [TT.MT, null], { | ||
| push: 'library', | ||
| sol: true | ||
| sol: true, | ||
| }); | ||
| var RULE_SETTING_LIBRARY_PIPE = r(/(\| +)(library)( +\|)/i, [TT.BK, TT.MT, TT.BK], { | ||
| const RULE_SETTING_LIBRARY_PIPE = r(/(\| +)(library)( +\|)/i, [TT.BK, TT.MT, TT.BK], { | ||
| push: 'library', | ||
| sol: true | ||
| sol: true, | ||
| }); | ||
| /** rule to escape the final closing bracket of a var at the end of a line */ | ||
| var RULE_LINE_ENDS_WITH_VAR = r(/\}\s*(?=$)/, TT.V2, { pop: true }); | ||
| var RULE_ELLIPSIS = r(/(\s*)(\.\.\.)/, [null, TT.BK], { sol: true }); | ||
| var RULE_NOT_ELLIPSIS_POP = r(/(?!\s*(\\|\.\.\.))/, null, { | ||
| const RULE_LINE_ENDS_WITH_VAR = r(/\}\s*(?=$)/, TT.V2, { pop: true }); | ||
| const RULE_ELLIPSIS = r(/(\s*)(\.\.\.)/, [null, TT.BK], { sol: true }); | ||
| const RULE_NOT_ELLIPSIS_POP = r(/(?!\s*(\\|\.\.\.))/, null, { | ||
| pop: true, | ||
| sol: true | ||
| sol: true, | ||
| }); | ||
| var RULE_DOC_TAGS = r(/(Tags:)(\s*)/i, [TT.MT, null], { push: 'tags_comma' }); | ||
| const RULE_DOC_TAGS = r(/(Tags:)(\s*)/i, [TT.MT, null], { push: 'tags_comma' }); | ||
| /** collects the states that we build */ | ||
| var states = {}; | ||
| const states = {}; | ||
| /** base isn't a state. these are the "normal business" that any state might use */ | ||
| var base = RULES_TABLE.concat([ | ||
| const base = [ | ||
| ...RULES_TABLE, | ||
| RULE_VAR_START, | ||
@@ -357,3 +348,4 @@ RULE_VAR_END, | ||
| /([^\s\$@&%=]((?!\t+|\s+\|\s+| +)([^=]|\\=))*?)(?==($| |[^=]|\s+\||\t))/, TT.AT), | ||
| r(/[^\s]+:(?!\/)/, TT.OP), | ||
| // r(/[^\s]+:(?!\/)/, TT.OP), // this was generating false positives with TRY | ||
| r(/(=!<>+\-*\/%)*==?/, TT.OP), | ||
| r(/_\*.*?\*_/, TT.SSE), | ||
@@ -364,4 +356,4 @@ r(/\*.*?\*/, TT.SS), | ||
| r(/[^\s\$@%&]+/, TT.ST), | ||
| r(/[\$@%&](?!\{)/, TT.ST) | ||
| ]); | ||
| r(/[\$@%&](?!\{)/, TT.ST), | ||
| ]; | ||
| /** the starting state (begining of a file) */ | ||
@@ -371,6 +363,7 @@ states.start = [ | ||
| mode: { spec: 'ipython' }, | ||
| sol: true | ||
| sol: true, | ||
| }), | ||
| r(/(%%[^\s]*).*$/, TT.MT, { sol: true }) | ||
| ].concat(base); | ||
| r(/(%%[^\s]*).*$/, TT.MT, { sol: true }), | ||
| ...base, | ||
| ]; | ||
| /** settings states */ | ||
@@ -384,4 +377,5 @@ states.settings = [ | ||
| RULE_SETTING_LIBRARY_PIPE, | ||
| r(/(\|*\s*)(resource|variables|documentation|metadata|test timeout|task timeout)(\s*)/i, [TT.BK, TT.MT, null], { sol: true }) | ||
| ].concat(base); | ||
| r(/(\|*\s*)(resource|variables|documentation|metadata|test timeout|task timeout)(\s*)/i, [TT.BK, TT.MT, null], { sol: true }), | ||
| ...base, | ||
| ]; | ||
| states.library = [ | ||
@@ -392,31 +386,80 @@ RULE_NOT_ELLIPSIS_POP, | ||
| r(/(WITH NAME)(\t+| +| +\| +)([^\|\s]*)(\s*)(\|?)(\s*)(?=$)/, [TT.AM, TT.BK, TT.DF, null, TT.BK, null], { | ||
| pop: true | ||
| }) | ||
| ].concat(base); | ||
| pop: true, | ||
| }), | ||
| ...base, | ||
| ]; | ||
| /** rule for behavior-driven-development keywords */ | ||
| var RULE_START_BDD = r(/(\|\s*\|\s*|\s\s+)?(given|when|then|and|but)/i, [TT.BK, TT.BE], { | ||
| const RULE_START_BDD = r(/(\|\s*\|\s*|\s\s+)?(given|when|then|and|but)/i, [TT.BK, TT.BE], { | ||
| push: 'keyword_invocation', | ||
| sol: true | ||
| sol: true, | ||
| }); | ||
| /** rule for whitespace keywords */ | ||
| var RULE_KEY_START = r(/(\t+| +)(?!\.\.\.)/, null, { | ||
| const RULE_KEY_START = r(/(\t+| +)(?!\.\.\.)/, null, { | ||
| push: 'keyword_invocation', | ||
| sol: true | ||
| sol: true, | ||
| }); | ||
| /** rule for pipe keywords */ | ||
| var RULE_KEY_START_PIPE = r(/(\| )(\s*)(|[^\|\s][^\|]*)(\s*)( \|)(\s+)/, [TT.BK, null, TT.SH, null, TT.BK, null], { | ||
| const RULE_KEY_START_PIPE = r(/(\| )(\s*)(|[^\|\s][^\|]*)(\s*)( \|)(\s+)/, [TT.BK, null, TT.SH, null, TT.BK, null], { | ||
| push: 'keyword_invocation', | ||
| sol: true | ||
| sol: true, | ||
| }); | ||
| /** rule for for old-style loops (slashes) */ | ||
| var RULE_START_LOOP_OLD = r(/(\s\|*\s*)(:FOR)(\s\|*\s*)/, [null, TT.AM, null], { | ||
| const RULE_START_LOOP_OLD = r(/(\s\|*\s*)(:FOR)(\s\|*\s*)/, [null, TT.AM, null], { | ||
| push: 'loop_start_old', | ||
| sol: true | ||
| sol: true, | ||
| }); | ||
| /** rule for for new-style loops (slashes) */ | ||
| var RULE_START_LOOP_NEW = r(/(\s\|*\s*)(FOR)(\s\|*\s*)/, [null, TT.AM, null], { | ||
| const RULE_START_LOOP_NEW = r(/(\s\|*\s*)(FOR)(\s\|*\s*)/, [null, TT.AM, null], { | ||
| push: 'loop_start_new', | ||
| sol: true | ||
| sol: true, | ||
| }); | ||
| var RULES_TAGS_COMMON = [ | ||
| /** rule for inline if keyword */ | ||
| const RULE_START_INLINE_IF = r(/(\s*)(IF)(\s\|*\s*)(?=[^\s].*\s{2,})/, [null, TT.AM, null], { push: 'inline_if_start', sol: true }); | ||
| /** rule for inline if keyword with assignment */ | ||
| const RULE_START_INLINE_IF_VAR = r(/(\s+)(.*?)(\s+)(=)(\s+)(IF)(\s\|*\s*)(?=[^\s].*\s{2,})/, [null, TT.V2, null, TT.OP, null, TT.AM, null], { push: 'inline_if_start', sol: true }); | ||
| /** rule for if keyword */ | ||
| const RULE_START_IF = r(/(\s\|*\s*)(IF)(\s\|*\s*)(?![^\s].*\s{2,})/, [null, TT.AM, null], { | ||
| push: 'if_start', | ||
| sol: true, | ||
| }); | ||
| /** rule for else if keyword */ | ||
| const RULE_START_IF_ELSE_IF = r(/(\s\|*\s*)(ELSE IF)(\s\|*\s*)/, [null, TT.AM, null], { | ||
| next: 'if_else_if_start', | ||
| sol: true, | ||
| }); | ||
| /** rule for else keyword */ | ||
| const RULE_START_IF_ELSE = r(/(\s\|*\s*)(ELSE)(?=$)/, [null, TT.AM], { | ||
| next: 'if_else_start', | ||
| sol: true, | ||
| }); | ||
| /** rule for try keyword */ | ||
| const RULE_START_TRY = r(/(\s\|*\s*)(TRY)(?=$)/, [null, TT.AM], { | ||
| push: 'try_start', | ||
| sol: true, | ||
| }); | ||
| /** rule for simple try/except */ | ||
| const RULE_START_EXCEPT = r(/(\s\|*\s*)(EXCEPT)/, [null, TT.AM], { | ||
| next: 'try_except_start', | ||
| sol: true, | ||
| }); | ||
| /** rule for try/else keyword */ | ||
| const RULE_START_TRY_ELSE = r(/(\s\|*\s*)(ELSE)(?=$)/, [null, TT.AM], { | ||
| next: 'try_else_start', | ||
| sol: true, | ||
| }); | ||
| /** rule for try/finally keyword */ | ||
| const RULE_START_FINALLY = r(/(\s\|*\s*)(FINALLY)/, [null, TT.AM], { | ||
| next: 'try_finally_start', | ||
| sol: true, | ||
| }); | ||
| const RULE_START_WHILE = r(/(\s\|*\s*)(WHILE)/, [null, TT.AM], { | ||
| push: 'while_start', | ||
| sol: true, | ||
| }); | ||
| /** rule for end keyword */ | ||
| const RULE_END = r(/([\|\s]*\s*)(END)(?=$)/, [null, TT.AM], { | ||
| sol: true, | ||
| pop: true, | ||
| }); | ||
| const RULES_TAGS_COMMON = [ | ||
| r(/\s\|\s*/, TT.BK), | ||
@@ -429,21 +472,23 @@ RULE_COMMENT_POP, | ||
| RULE_VAR_END, | ||
| r(/ +/, null) | ||
| r(/ +/, null), | ||
| ]; | ||
| /** rules for capturing individual tags */ | ||
| states.tags = RULES_TAGS_COMMON.concat([ | ||
| states.tags = [ | ||
| ...RULES_TAGS_COMMON, | ||
| r(/[^\$&%@]*?(?=( +| \|))/, TT.TG), | ||
| // fall back to single char | ||
| r(/[^\$&%@|]/, TT.TG) | ||
| ]); | ||
| r(/[^\$&%@|]/, TT.TG), | ||
| ]; | ||
| /** rules for capturing tags inside docs */ | ||
| states.tags_comma = RULES_TAGS_COMMON.concat([ | ||
| states.tags_comma = [ | ||
| ...RULES_TAGS_COMMON, | ||
| r(/(,)(\s*)/, [TT.PC, null]), | ||
| r(/[^\$&%@,]+(?=,$)/, TT.TG), | ||
| // fall back to single char | ||
| r(/[^\$&%@|,]/, TT.TG) | ||
| ]); | ||
| r(/[^\$&%@|,]/, TT.TG), | ||
| ]; | ||
| /** need to catch empty white lines pretty explicitly */ | ||
| var RULE_WS_LINE = r(/\s*(?=$)/, null, { sol: true }); | ||
| const RULE_WS_LINE = r(/\s*(?=$)/, null, { sol: true }); | ||
| /** not a state. rules for starting keyword invocation */ | ||
| var RULES_KEYWORD_INVOKING = [ | ||
| const RULES_KEYWORD_INVOKING = [ | ||
| RULE_START_BDD, | ||
@@ -453,6 +498,23 @@ RULE_KEY_START_PIPE, | ||
| r(/\|\s(?=[^\s*]*\|)/, null, { sol: true, push: 'keyword_invocation' }), | ||
| r(/(?=[^\s*])/, null, { sol: true, push: 'keyword_invocation' }) | ||
| r(/(?=[^\s*])/, null, { sol: true, push: 'keyword_invocation' }), | ||
| ]; | ||
| var RULE_SETTING_SIMPLE = r(/(\t+| +)(\[\s*)(arguments|documentation|return|timeout)(\s*\])(\s*)/i, [null, TT.MT, TT.MT, TT.MT, null], { sol: true }); | ||
| var RULE_SETTING_SIMPLE_PIPE = r(/(\|)(\s+)([^|*]*)(\s+)(\|)(\s+)(\[\s*)(arguments|documentation|return|timeout)(\s*\])(\s*)(\|?)/i, [TT.BK, null, TT.SH, null, TT.BK, null, TT.MT, TT.MT, TT.MT, null, TT.BK], { sol: true }); | ||
| const RULE_SETTING_SIMPLE = r(/(\t+| +)(\[\s*)(arguments|documentation|return|timeout)(\s*\])(\s*)/i, [null, TT.MT, TT.MT, TT.MT, null], { sol: true }); | ||
| const RULE_SETTING_SIMPLE_PIPE = r(/(\|)(\s+)([^|*]*)(\s+)(\|)(\s+)(\[\s*)(arguments|documentation|return|timeout)(\s*\])(\s*)(\|?)/i, [TT.BK, null, TT.SH, null, TT.BK, null, TT.MT, TT.MT, TT.MT, null, TT.BK], { sol: true }); | ||
| /** rule for atomic control flow */ | ||
| const RULE_CONTROL_FLOW_ATOM = r(/(\s*)(BREAK|CONTINUE|RETURN)([\s\|]{2,}|$)/, [ | ||
| null, | ||
| TT.AM, | ||
| null, | ||
| ]); | ||
| /** rules for starting control flow blocks */ | ||
| const RULES_CONTROL_FLOW = [ | ||
| RULE_CONTROL_FLOW_ATOM, | ||
| RULE_START_LOOP_OLD, | ||
| RULE_START_LOOP_NEW, | ||
| RULE_START_WHILE, | ||
| RULE_START_INLINE_IF_VAR, | ||
| RULE_START_INLINE_IF, | ||
| RULE_START_IF, | ||
| RULE_START_TRY, | ||
| ]; | ||
| /** rules for data rows inside a keyword table */ | ||
@@ -466,12 +528,15 @@ states.keywords = [ | ||
| r(/(?=[^\s$&%@*|]+)/, null, { sol: true, push: 'keyword_def' }), | ||
| RULE_START_LOOP_OLD, | ||
| RULE_START_LOOP_NEW, | ||
| RULE_WS_LINE | ||
| ].concat(RULES_KEYWORD_INVOKING, base); | ||
| ...RULES_CONTROL_FLOW, | ||
| RULE_WS_LINE, | ||
| ...RULES_KEYWORD_INVOKING, | ||
| ...base, | ||
| ]; | ||
| /** a keyword name fragment before an inline variable */ | ||
| var KEYWORD_WORD_BEFORE_VAR = /([^\s]*?(?=[\$&%@]\{))/i; | ||
| const KEYWORD_WORD_BEFORE_VAR = /([^\s]*?(?=[\$&%@]\{))/i; | ||
| /** a keyword containing spaces before a separator */ | ||
| const KEYWORD_WORD_WITH_SPACES_BEFORE_SEP = /(?:[^\t\n\r\|])+?(?=$|\t|\n|\r| +)/; | ||
| /** a keyword name fragment before a separator */ | ||
| var KEYWORD_WORD_BEFORE_SEP = /[^\s\|]+(?=$|[|]|\t| +)/; | ||
| const KEYWORD_WORD_BEFORE_SEP = /[^\s\|]+(?=$|[|]|\t| +)/; | ||
| /** a keyword name fragment before a non-separator whitespace character */ | ||
| var KEYWORD_WORD_BEFORE_WS = /([^\n\$\s*=\|]+?(?= ))/i; | ||
| const KEYWORD_WORD_BEFORE_WS = /([^\n\$\s*=\|]+?(?= ))/i; | ||
| states.keyword_def = [ | ||
@@ -485,10 +550,6 @@ RULE_VAR_START, | ||
| r(KEYWORD_WORD_BEFORE_WS, TT.DF), | ||
| r(/(?=$)/, null, { sol: true, pop: true }) | ||
| r(/(?=$)/, null, { sol: true, pop: true }), | ||
| ]; | ||
| /** A range as used in for loops */ | ||
| var RULE_RANGE = r(/([\|\s]*\s*)(IN)( RANGE| ENUMERATE| ZIP)?/, [ | ||
| null, | ||
| TT.AM, | ||
| TT.AM | ||
| ]); | ||
| const RULE_RANGE = r(/([\|\s]*\s*)(IN)( RANGE| ENUMERATE| ZIP)?/, [null, TT.AM, TT.AM]); | ||
| states.loop_start_new = [ | ||
@@ -500,5 +561,146 @@ RULE_RANGE, | ||
| RULE_VAR_END, | ||
| r(/([\|\s]*\s*)(END)/, [null, TT.AM], { sol: true, pop: true }), | ||
| RULE_WS_LINE | ||
| ].concat(RULES_KEYWORD_INVOKING, base); | ||
| ...RULES_CONTROL_FLOW, | ||
| RULE_END, | ||
| RULE_WS_LINE, | ||
| ...RULES_KEYWORD_INVOKING, | ||
| ...base, | ||
| ]; | ||
| /** the state when in an (ELSE)IF predictate */ | ||
| states.inline_if_start = [ | ||
| RULE_ELLIPSIS, | ||
| r(/[\s\|]{2,}/, null, { next: 'inline_if_start_keyword' }), | ||
| RULE_NOT_ELLIPSIS_POP, | ||
| RULE_VAR_START, | ||
| r(/\}(?=$)/, TT.V2), | ||
| RULE_VAR_END, | ||
| ...base, | ||
| ]; | ||
| /** the state when in an ELSE( IF) object */ | ||
| states.inline_if_start_keyword = [ | ||
| RULE_ELLIPSIS, | ||
| RULE_CONTROL_FLOW_ATOM, | ||
| RULE_NOT_ELLIPSIS_POP, | ||
| r(KEYWORD_WORD_BEFORE_VAR, TT.KW, { next: 'inline_if_keyword_invoking' }), | ||
| r(KEYWORD_WORD_WITH_SPACES_BEFORE_SEP, TT.KW, { next: 'inline_if_keyword_invoking' }), | ||
| r(KEYWORD_WORD_BEFORE_SEP, TT.KW, { next: 'inline_if_keyword_invoking' }), | ||
| r(KEYWORD_WORD_BEFORE_WS, TT.KW, { next: 'inline_if_keyword_invoking' }), | ||
| ]; | ||
| /** the state when in an ELSE( IF) object */ | ||
| states.inline_if_keyword_invoking = [ | ||
| RULE_ELLIPSIS, | ||
| RULE_NOT_ELLIPSIS_POP, | ||
| r(/(\s\|*\s*)(ELSE IF)(\s\|*\s*)/, [null, TT.AM, null], { next: 'inline_if_start' }), | ||
| r(/(\s\|*\s*)(ELSE)(\s\|*\s*)/, [null, TT.AM, null], { | ||
| next: 'inline_if_start_else', | ||
| }), | ||
| RULE_VAR_START, | ||
| r(/\}(?=$)/, TT.V2), | ||
| RULE_VAR_END, | ||
| ...base, | ||
| ]; | ||
| states.inline_if_start_else = [ | ||
| RULE_ELLIPSIS, | ||
| r(KEYWORD_WORD_BEFORE_VAR, TT.KW, { next: 'inline_if_else_keyword_invoking' }), | ||
| r(KEYWORD_WORD_WITH_SPACES_BEFORE_SEP, TT.KW, { | ||
| next: 'inline_if_else_keyword_invoking', | ||
| }), | ||
| r(KEYWORD_WORD_BEFORE_SEP, TT.KW, { next: 'inline_if_else_keyword_invoking' }), | ||
| r(KEYWORD_WORD_BEFORE_WS, TT.KW, { next: 'inline_if_else_keyword_invoking' }), | ||
| ...base, | ||
| ]; | ||
| states.inline_if_else_keyword_invoking = [ | ||
| RULE_ELLIPSIS, | ||
| RULE_NOT_ELLIPSIS_POP, | ||
| RULE_VAR_START, | ||
| r(/\}(?=$)/, TT.V2), | ||
| RULE_VAR_END, | ||
| ...base, | ||
| ]; | ||
| states.if_start = [ | ||
| r(/[.]{3}/, TT.BK), | ||
| RULE_VAR_START, | ||
| r(/\}(?=$)/, TT.V2), | ||
| RULE_VAR_END, | ||
| ...RULES_CONTROL_FLOW, | ||
| RULE_START_IF_ELSE_IF, | ||
| RULE_START_IF_ELSE, | ||
| RULE_END, | ||
| RULE_WS_LINE, | ||
| ...RULES_KEYWORD_INVOKING, | ||
| ...base, | ||
| ]; | ||
| states.if_else_if_start = [ | ||
| r(/[.]{3}/, TT.BK), | ||
| RULE_VAR_START, | ||
| r(/\}(?=$)/, TT.V2), | ||
| RULE_VAR_END, | ||
| ...RULES_CONTROL_FLOW, | ||
| RULE_START_IF_ELSE_IF, | ||
| RULE_START_IF_ELSE, | ||
| RULE_END, | ||
| RULE_WS_LINE, | ||
| ...RULES_KEYWORD_INVOKING, | ||
| ...base, | ||
| ]; | ||
| states.if_else_start = [ | ||
| ...RULES_CONTROL_FLOW, | ||
| RULE_END, | ||
| RULE_WS_LINE, | ||
| ...RULES_KEYWORD_INVOKING, | ||
| ...base, | ||
| ]; | ||
| states.try_start = [ | ||
| ...RULES_CONTROL_FLOW, | ||
| RULE_START_EXCEPT, | ||
| RULE_START_TRY_ELSE, | ||
| RULE_START_FINALLY, | ||
| RULE_END, | ||
| RULE_WS_LINE, | ||
| ...RULES_KEYWORD_INVOKING, | ||
| ...base, | ||
| ]; | ||
| states.try_except_start = [ | ||
| r(/[.]{3}/, TT.BK), | ||
| r(/AS/, TT.AM), | ||
| r(/(glob|regexp):/i, TT.BI), | ||
| RULE_VAR_START, | ||
| r(/\}(?=$)/, TT.V2), | ||
| RULE_VAR_END, | ||
| ...RULES_CONTROL_FLOW, | ||
| RULE_START_EXCEPT, | ||
| RULE_START_TRY_ELSE, | ||
| RULE_START_FINALLY, | ||
| RULE_END, | ||
| RULE_WS_LINE, | ||
| ...RULES_KEYWORD_INVOKING, | ||
| ...base, | ||
| ]; | ||
| states.try_else_start = [ | ||
| ...RULES_CONTROL_FLOW, | ||
| RULE_START_FINALLY, | ||
| RULE_END, | ||
| RULE_WS_LINE, | ||
| ...RULES_KEYWORD_INVOKING, | ||
| ...base, | ||
| ]; | ||
| states.try_finally_start = [ | ||
| ...RULES_CONTROL_FLOW, | ||
| RULE_END, | ||
| RULE_WS_LINE, | ||
| ...RULES_KEYWORD_INVOKING, | ||
| ...base, | ||
| ]; | ||
| states.while_start = [ | ||
| r(/[.]{3}/, TT.BK), | ||
| r(/AS/, TT.AM), | ||
| r(/(glob|regexp):/i, TT.BI), | ||
| RULE_VAR_START, | ||
| r(/\}(?=$)/, TT.V2), | ||
| RULE_VAR_END, | ||
| ...RULES_CONTROL_FLOW, | ||
| RULE_END, | ||
| RULE_WS_LINE, | ||
| ...RULES_KEYWORD_INVOKING, | ||
| ...base, | ||
| ]; | ||
| states.loop_start_old = [ | ||
@@ -509,15 +711,24 @@ r(/(?=.*)/, null, { sol: true, next: 'loop_body_old' }), | ||
| r(/\}(?=$)/, TT.V2), | ||
| RULE_VAR_END | ||
| ].concat(base); | ||
| states.loop_body_old = RULES_KEYWORD_INVOKING.map(function (rule) { | ||
| return __assign({}, rule, { regex: new RegExp(/([\|\s]*\s*)(\\)/.source + | ||
| (rule.regex instanceof RegExp ? rule.regex.source : rule.regex)), token: rule.token instanceof Array | ||
| ? [null, TT.BK].concat(rule.token) : [null, TT.BK, rule.token] }); | ||
| }).concat([ | ||
| r(/(?=\s+[^\\])/, null, { pop: true, sol: true }) | ||
| ], base); | ||
| var RULE_CASE_SETTING_SIMPLE = r(/(\t+| +)(\[\s*)(documentation|timeout)(\s*\])(\s*)/i, [null, TT.MT, TT.MT, TT.MT, null], { sol: true }); | ||
| var RULE_CASE_SETTING_SIMPLE_PIPE = r(/(\|)(\s+)([^|*]*)(\s+)(\|)(\s+)(\[\s*)(documentation|timeout)(\s*\])(\s*)(\|?)/i, [TT.BK, null, TT.SH, null, TT.BK, null, TT.MT, TT.MT, TT.MT, null, TT.BK], { sol: true }); | ||
| RULE_VAR_END, | ||
| ...base, | ||
| ]; | ||
| states.loop_body_old = [ | ||
| ...RULES_KEYWORD_INVOKING.map((rule) => { | ||
| return { | ||
| ...rule, | ||
| regex: new RegExp(/([\|\s]*\s*)(\\)/.source + | ||
| (rule.regex instanceof RegExp ? rule.regex.source : rule.regex)), | ||
| token: rule.token instanceof Array | ||
| ? [null, TT.BK, ...rule.token] | ||
| : [null, TT.BK, rule.token], | ||
| }; | ||
| }), | ||
| r(/(?=\s+[^\\])/, null, { pop: true, sol: true }), | ||
| ...base, | ||
| ]; | ||
| const RULE_CASE_SETTING_SIMPLE = r(/(\t+| +)(\[\s*)(documentation|timeout)(\s*\])(\s*)/i, [null, TT.MT, TT.MT, TT.MT, null], { sol: true }); | ||
| const RULE_CASE_SETTING_SIMPLE_PIPE = r(/(\|)(\s+)([^|*]*)(\s+)(\|)(\s+)(\[\s*)(documentation|timeout)(\s*\])(\s*)(\|?)/i, [TT.BK, null, TT.SH, null, TT.BK, null, TT.MT, TT.MT, TT.MT, null, TT.BK], { sol: true }); | ||
| /** rules for data rows inside test/task definition */ | ||
| states.test_cases = RULES_TABLE.concat([ | ||
| states.test_cases = [ | ||
| ...RULES_TABLE, | ||
| RULE_WS_LINE, | ||
@@ -529,13 +740,13 @@ RULE_ELLIPSIS, | ||
| RULE_CASE_SETTING_SIMPLE_PIPE, | ||
| RULE_START_LOOP_OLD, | ||
| RULE_START_LOOP_NEW, | ||
| r(/([^|\s*].+?)(?=(\t| +|$))/, TT.SH, { sol: true }) | ||
| ], RULES_KEYWORD_INVOKING, [ | ||
| ...RULES_CONTROL_FLOW, | ||
| r(/([^|\s*].+?)(?=(\t| +|$))/, TT.SH, { sol: true }), | ||
| ...RULES_KEYWORD_INVOKING, | ||
| r(/(\|\s+)([^\s*\|\.][^\|]*?)(\s*)(\|?$)/, [TT.BK, TT.SH, TT.BK], { | ||
| sol: true | ||
| sol: true, | ||
| }), | ||
| r(/(\| +)([^\|\s].+?)(\s*)( \| )/, [TT.BK, TT.SH, null, TT.BK], { | ||
| sol: true | ||
| }) | ||
| ], base); | ||
| sol: true, | ||
| }), | ||
| ...base, | ||
| ]; | ||
| /** rules for inside of an invoked keyword instance */ | ||
@@ -545,3 +756,3 @@ states.keyword_invocation = [ | ||
| r(/(?=\s*$)/, null, { pop: true }), | ||
| r(/(\\|\.\.\.) +/, TT.BK, { pop: true }), | ||
| r(/(\\|\.\.\.) +/, TT.BK), | ||
| RULE_VAR_START, | ||
@@ -555,10 +766,13 @@ RULE_LINE_ENDS_WITH_VAR, | ||
| r(KEYWORD_WORD_BEFORE_VAR, TT.KW, { pop: true }), | ||
| r(KEYWORD_WORD_WITH_SPACES_BEFORE_SEP, TT.KW, { pop: true }), | ||
| r(KEYWORD_WORD_BEFORE_SEP, TT.KW, { pop: true }), | ||
| r(KEYWORD_WORD_BEFORE_WS, TT.KW) | ||
| ].concat(base); | ||
| r(KEYWORD_WORD_BEFORE_WS, TT.KW), | ||
| ...base, | ||
| ]; | ||
| states.keyword_invocation_no_continue = [ | ||
| RULE_NOT_ELLIPSIS_POP | ||
| ].concat(states.keyword_invocation); | ||
| RULE_NOT_ELLIPSIS_POP, | ||
| ...states.keyword_invocation, | ||
| ]; | ||
| /** curious rule for the variables table */ | ||
| states.variables = base.slice(); | ||
| states.variables = [...base]; | ||
| /** rules for inside of a variable reference */ | ||
@@ -577,3 +791,3 @@ states.variable = [ | ||
| r(/\}/, TT.V2, { pop: true }), | ||
| r(/[^\{\}\n:]/, TT.V2) | ||
| r(/[^\{\}\n:]/, TT.V2), | ||
| ]; | ||
@@ -595,16 +809,8 @@ /** rules for extended syntax in a variable reference */ | ||
| r(/\t*(?=$|\n)/, null, { pop: true }), | ||
| r(/[^}]/, TT.PR) | ||
| r(/[^}]/, TT.PR), | ||
| ]; | ||
| /** rules for strings with single quotes */ | ||
| states.single_string = [ | ||
| r(/\\'/, TT.ST), | ||
| r(/'/, TT.ST, { pop: true }), | ||
| r(/./, TT.ST) | ||
| ]; | ||
| states.single_string = [r(/\\'/, TT.ST), r(/'/, TT.ST, { pop: true }), r(/./, TT.ST)]; | ||
| /** rules for strings with double quotes */ | ||
| states.double_string = [ | ||
| r(/\\"/, TT.ST), | ||
| r(/"/, TT.ST, { pop: true }), | ||
| r(/./, TT.ST) | ||
| ]; | ||
| states.double_string = [r(/\\"/, TT.ST), r(/"/, TT.ST, { pop: true }), r(/./, TT.ST)]; | ||
| /** rules for square-bracketed index referencing */ | ||
@@ -620,5 +826,5 @@ states.variable_index = [ | ||
| r(/\]/, TT.BK, { pop: true }), | ||
| r(/[^\]]/, TT.ST) | ||
| r(/[^\]]/, TT.ST), | ||
| ]; | ||
| /** the actual exported function that will install the mode in CodeMirror */ | ||
| CodeMirror.defineSimpleMode( | ||
@@ -625,0 +831,0 @@ 'robotframework', |
| name: "smoketest" | ||
| on: | ||
| push: | ||
| pull_request: | ||
| jobs: | ||
| smoketest: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| robotframework-version: [rf32, rf40, rf41, rf50] | ||
| steps: | ||
| - uses: actions/checkout@v2.4.0 | ||
| - uses: cachix/install-nix-action@v16 | ||
| with: | ||
| nix_path: nixpkgs=channel:nixos-unstable | ||
| - uses: cachix/cachix-action@v10 | ||
| with: | ||
| name: robots-from-jupyter | ||
| # If you chose signing key for write access | ||
| signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' | ||
| # If you chose API tokens for write access OR if you have a private cache | ||
| authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | ||
| - run: nix-shell setup.nix -A shell --argstr robotframework ${{ matrix.robotframework-version }} --run "make test" | ||
| - run: nix-shell setup.nix -A shell --argstr robotframework ${{ matrix.robotframework-version }} --run "python -m robotkernel.install" | ||
| - run: nix-shell setup.nix -A shell --argstr robotframework ${{ matrix.robotframework-version }} --run "jupyter nbconvert --execute tests/Smoketest.ipynb --to html" | ||
| - run: nix-shell setup.nix -A shell --argstr robotframework ${{ matrix.robotframework-version }} --run "jupyter nbconvert --execute tests/StickyLibraryMagic.ipynb --to html" | ||
| - run: nix-shell setup.nix -A shell --argstr robotframework ${{ matrix.robotframework-version }} --run "nbrobot -v BROWSER:headlessfirefox -F ipynb tests atest" | ||
| - run: nix-shell --run "echo OK" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
| diff --git a/target/src/SikuliLibrary/sikuli.py b/target/src/SikuliLibrary/sikuli.py | ||
| index 0348e7f..a2461d3 100644 | ||
| --- a/target/src/SikuliLibrary/sikuli.py | ||
| +++ b/target/src/SikuliLibrary/sikuli.py | ||
| @@ -50,6 +50,7 @@ class SikuliLibrary(object): | ||
| self.port = None | ||
| self.remote = None | ||
| self.mode = mode.upper().strip() | ||
| + self.process = None | ||
| if mode == 'OLD': | ||
| self.start_sikuli_process(port) | ||
| if mode.upper().strip() == 'DOC': | ||
| @@ -154,6 +155,8 @@ class SikuliLibrary(object): | ||
| sikuliJar = jarList[0] | ||
| java = 'java' | ||
| arguments = ['-jar', sikuliJar, str(self.port), self._get_output_folder()] | ||
| + if self.process: | ||
| + self.process.terminate_process() | ||
| self.process = Process() | ||
| if os.getenv("DISABLE_SIKULI_LOG"): | ||
| self.process.start_process(java, *arguments, shell=True) | ||
| @@ -247,6 +250,10 @@ class SikuliLibrary(object): | ||
| def run_keyword(self, name, arguments=[], kwargs={}): | ||
| if name == 'start_sikuli_process': | ||
| return self.start_sikuli_process(*arguments) | ||
| + elif name == 'stop_remote_server': | ||
| + value = self.remote.run_keyword(name, arguments, kwargs) | ||
| + self.process.terminate_process() | ||
| + return value | ||
| return self.remote.run_keyword(name, arguments, kwargs) | ||
| def _stop_thread(self, timeout): | ||
| @@ -256,3 +263,7 @@ class SikuliLibrary(object): | ||
| thread = threading.Thread(target=stop, args=()) | ||
| thread.start() | ||
| + | ||
| + def __del__(self): | ||
| + if self.process: | ||
| + self.process.terminate_process() |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
4006
5.53%30878357
-1.54%110
-4.35%