Skip to content

Commit

Permalink
2.3.5: minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
acaldero committed Oct 2, 2024
1 parent cb0f8e6 commit 0284415
Show file tree
Hide file tree
Showing 12 changed files with 40 additions and 225 deletions.
68 changes: 0 additions & 68 deletions external/codemirror/mode/gas/index.html
Original file line number Diff line number Diff line change
@@ -1,68 +0,0 @@
<!doctype html>

<title>CodeMirror: Gas mode</title>
<meta charset="utf-8"/>
<link rel=stylesheet href="../../doc/docs.css">

<link rel="stylesheet" href="../../lib/codemirror.css">
<script src="../../lib/codemirror.js"></script>
<script src="gas.js"></script>
<style>.CodeMirror {border: 2px inset #dee;}</style>
<div id=nav>
<a href="https://codemirror.net/5"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png" alt=""></a>

<ul>
<li><a href="../../index.html">Home</a>
<li><a href="../../doc/manual.html">Manual</a>
<li><a href="https://github.com/codemirror/codemirror5">Code</a>
</ul>
<ul>
<li><a href="../index.html">Language modes</a>
<li><a class=active href="#">Gas</a>
</ul>
</div>

<article>
<h2>Gas mode</h2>
<form>
<textarea id="code" name="code">
.syntax unified
.global main

/*
* A
* multi-line
* comment.
*/

@ A single line comment.

main:
push {sp, lr}
ldr r0, =message
bl puts
mov r0, #0
pop {sp, pc}

message:
.asciz "Hello world!<br />"
</textarea>
</form>

<script>
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
lineNumbers: true,
mode: {name: "gas", architecture: "ARMv6"},
});
</script>

<p>Handles AT&amp;T assembler syntax (more specifically this handles
the GNU Assembler (gas) syntax.)
It takes a single optional configuration parameter:
<code>architecture</code>, which can be one of <code>"ARM"</code>,
<code>"ARMv6"</code> or <code>"x86"</code>.
Including the parameter adds syntax for the registers and special
directives for the supplied architecture.

<p><strong>MIME types defined:</strong> <code>text/x-gas</code></p>
</article>
118 changes: 0 additions & 118 deletions external/codemirror/mode/javascript/index.html
Original file line number Diff line number Diff line change
@@ -1,118 +0,0 @@
<!doctype html>

<title>CodeMirror: JavaScript mode</title>
<meta charset="utf-8"/>
<link rel=stylesheet href="../../doc/docs.css">

<link rel="stylesheet" href="../../lib/codemirror.css">
<script src="../../lib/codemirror.js"></script>
<script src="../../addon/edit/matchbrackets.js"></script>
<script src="../../addon/comment/continuecomment.js"></script>
<script src="../../addon/comment/comment.js"></script>
<script src="javascript.js"></script>
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
<div id=nav>
<a href="https://codemirror.net/5"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png" alt=""></a>

<ul>
<li><a href="../../index.html">Home</a>
<li><a href="../../doc/manual.html">Manual</a>
<li><a href="https://github.com/codemirror/codemirror5">Code</a>
</ul>
<ul>
<li><a href="../index.html">Language modes</a>
<li><a class=active href="#">JavaScript</a>
</ul>
</div>

<article>
<h2>JavaScript mode</h2>


<div><textarea id="code" name="code">
// Demo code (the actual new parser character stream implementation)

function StringStream(string) {
this.pos = 0;
this.string = string;
}

StringStream.prototype = {
done: function() {return this.pos >= this.string.length;},
peek: function() {return this.string.charAt(this.pos);},
next: function() {
if (this.pos &lt; this.string.length)
return this.string.charAt(this.pos++);
},
eat: function(match) {
var ch = this.string.charAt(this.pos);
if (typeof match == "string") var ok = ch == match;
else var ok = ch &amp;&amp; match.test ? match.test(ch) : match(ch);
if (ok) {this.pos++; return ch;}
},
eatWhile: function(match) {
var start = this.pos;
while (this.eat(match));
if (this.pos > start) return this.string.slice(start, this.pos);
},
backUp: function(n) {this.pos -= n;},
column: function() {return this.pos;},
eatSpace: function() {
var start = this.pos;
while (/\s/.test(this.string.charAt(this.pos))) this.pos++;
return this.pos - start;
},
match: function(pattern, consume, caseInsensitive) {
if (typeof pattern == "string") {
function cased(str) {return caseInsensitive ? str.toLowerCase() : str;}
if (cased(this.string).indexOf(cased(pattern), this.pos) == this.pos) {
if (consume !== false) this.pos += str.length;
return true;
}
}
else {
var match = this.string.slice(this.pos).match(pattern);
if (match &amp;&amp; consume !== false) this.pos += match[0].length;
return match;
}
}
};
</textarea></div>

<script>
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
lineNumbers: true,
matchBrackets: true,
continueComments: "Enter",
extraKeys: {"Ctrl-Q": "toggleComment"}
});
</script>

<p>
JavaScript mode supports several configuration options:
<ul>
<li><code>json</code> which will set the mode to expect JSON
data rather than a JavaScript program.</li>
<li><code>jsonld</code> which will set the mode to expect
<a href="http://json-ld.org">JSON-LD</a> linked data rather
than a JavaScript program (<a href="json-ld.html">demo</a>).</li>
<li><code>typescript</code> which will activate additional
syntax highlighting and some other things for TypeScript code
(<a href="typescript.html">demo</a>).</li>
<li><code>trackScope</code> can be set to false to turn off
tracking of local variables. This will prevent locals from
getting the <code>"variable-2"</code> token type, and will
break completion of locals with javascript-hint.</li>
<li><code>statementIndent</code> which (given a number) will
determine the amount of indentation to use for statements
continued on a new line.</li>
<li><code>wordCharacters</code>, a regexp that indicates which
characters should be considered part of an identifier.
Defaults to <code>/[\w$]/</code>, which does not handle
non-ASCII identifiers. Can be set to something more elaborate
to improve Unicode support.</li>
</ul>
</p>

<p><strong>MIME types defined:</strong> <code>text/javascript</code>, <code>application/javascript</code>, <code>application/x-javascript</code>, <code>text/ecmascript</code>, <code>application/ecmascript</code>, <code>application/json</code>, <code>application/x-json</code>, <code>application/manifest+json</code>, <code>application/ld+json</code>, <code>text/typescript</code>, <code>application/typescript</code>.</p>
</article>
62 changes: 27 additions & 35 deletions sim_sw/assembly/compiler2_asm_obj.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,50 +130,42 @@ function wsasm_get_similar_candidates ( context, elto )
msg += i18n_get_TagFor('compiler', 'NOT MATCH FORMAT') + ":<br>" ;
for (let key in context.firmware)
{
if (key == elto.value.instruction)
{ // "li" == "li"
if ( (key.includes(elto.value.instruction)) || (elto.value.instruction.includes(key)) )
{ // "sli" == "li", "li" == "li", ...
for (let k=0; k<context.firmware[key].length; k++)
{
candidate = context.firmware[key][k] ;

msg += "<span class='m-1'>\u2714</span> " + candidate.signature_user ;
if (candidate.isPseudoinstruction) {
msg += "<br> " + tab + "pseudoinstruction for: " + candidate.finish.substr(0, 10) + "...<br>" ;
if (candidate.isPseudoinstruction)
{
msg += "<br> " + tab + "pseudoinstruction for: " ;
if (candidate.finish.length > 12)
msg += candidate.finish.substr(0, 10) + "..." ;
else msg += candidate.finish ;
}
msg += "<br>" ;

// more details for exact match...
msg = msg + tab + elto.value.instruction + " " ;
for (var i=0; i<elto.value.signature_type_arr.length; i++)
// more details for exact match -> e.g.: "li" == "li"...
if (key == elto.value.instruction)
{
if (elto.value.signature_type_arr[i] != candidate.signature_type_arr[i]) {
msg = msg + " **" + elto.value.fields[i-1] + "** not matching" ;
break ;
}
if (elto.value.signature_size_arr[i] > candidate.signature_size_arr[i]) {
msg = msg + " **" + elto.value.fields[i-1] + "** needs more bits" ;
break ;
}
if (i > 0) {
msg = msg + elto.value.fields[i-1] + " " ;
}
msg = msg + tab + elto.value.instruction + " " ;
for (var i=0; i<elto.value.signature_type_arr.length; i++)
{
if (elto.value.signature_type_arr[i] != candidate.signature_type_arr[i]) {
msg = msg + " **" + elto.value.fields[i-1] + "** not matching" ;
break ;
}
if (elto.value.signature_size_arr[i] > candidate.signature_size_arr[i]) {
msg = msg + " **" + elto.value.fields[i-1] + "** needs more bits" ;
break ;
}
if (i > 0) {
msg = msg + elto.value.fields[i-1] + " " ;
}
}
msg += "<br>" ;
}

msg += "<br>" ;
}

}
else if ( (key.includes(elto.value.instruction)) || (elto.value.instruction.includes(key)) )
{ // "sli" == "li"
for (let k=0; k<context.firmware[key].length; k++)
{
candidate = context.firmware[key][k] ;

msg += "<span class='m-1'>\u2714</span> " + candidate.signature_user ;
if (context.firmware[key][k].isPseudoinstruction) {
msg += "<br> " + tab + " pseudoinstruction for: " + candidate.finish.substr(0, 10) + "...<br>" ;
}

msg += "<br>" ;
}
}
}
Expand Down
1 change: 1 addition & 0 deletions wepsim_web/wepsim_web_classic.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-2DWH3VVSR9', { 'cookie_flags': 'SameSite=None; Secure' });
gtag('set', 'cookie_flags', 'SameSite=None; Secure');
</script>
<!-- End Global site tag (gtag.js) - Google Analytics -->

Expand Down
1 change: 1 addition & 0 deletions wepsim_web/wepsim_web_compact.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-2DWH3VVSR9', { 'cookie_flags': 'SameSite=None; Secure' });
gtag('set', 'cookie_flags', 'SameSite=None; Secure');
</script>
<!-- End Global site tag (gtag.js) - Google Analytics -->

Expand Down
6 changes: 5 additions & 1 deletion wepsim_web/wepsim_web_editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,11 @@
}

wepsim_notify_error('<strong>ERROR</strong>',
errorMsg + '<br>' + '<center>' + lineMsg +
'<div class="container-fluid p-1" style="overflow:auto; -webkit-overflow-scrolling:touch;">' +
errorMsg + '<br>' +
'</div>' +
'<center>' +
lineMsg +
'<button type="button" class="btn btn-danger" ' +
' onclick="wepsim_notify_close();"><span data-langkey="Close">Close</span></button>' +
'</center>') ;
Expand Down
1 change: 1 addition & 0 deletions ws_dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-2DWH3VVSR9', { 'cookie_flags': 'SameSite=None; Secure' });
gtag('set', 'cookie_flags', 'SameSite=None; Secure');
</script>
<!-- End Global site tag (gtag.js) - Google Analytics -->

Expand Down
2 changes: 1 addition & 1 deletion ws_dist/min.sim_all.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ws_dist/min.wepsim_node.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ws_dist/min.wepsim_web.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions ws_dist/wepsim-classic.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-2DWH3VVSR9', { 'cookie_flags': 'SameSite=None; Secure' });
gtag('set', 'cookie_flags', 'SameSite=None; Secure');
</script>
<!-- End Global site tag (gtag.js) - Google Analytics -->

Expand Down
1 change: 1 addition & 0 deletions ws_dist/wepsim-compact.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-2DWH3VVSR9', { 'cookie_flags': 'SameSite=None; Secure' });
gtag('set', 'cookie_flags', 'SameSite=None; Secure');
</script>
<!-- End Global site tag (gtag.js) - Google Analytics -->

Expand Down

0 comments on commit 0284415

Please sign in to comment.