asm mode improvements

dev/git-series/gccdum
Matt Godbolt 7 years ago
parent d68472fed4
commit cca68918d3

@ -1,17 +1,17 @@
# Default settings for GCC Explorer.
port=10240
compileTimeoutMs=5000
#compilers=/home/mgodbolt/.fighome/runtime/gcc/4.9.2-1/bin/g++
#clientSharingEnabled=false
compilers=/home/mgodbolt/.fighome/runtime/gcc/4.9.2-1/bin/g++
clientSharingEnabled=false
tempDirCleanupSecs=10
compilers=r100
compiler.r100.exe=/mnt/data/apps/rust/bin/rustc
compiler.r100.name=rustc 1.0.0
compiler.r100.intelAsm=-Cllvm-args=--x86-asm-syntax=intel
compileFilename=example.rs
compileToAsm=--emit asm --crate-type staticlib
cacheMb=100
language=Rust
options=-O --crate-type staticlib
clientGoogleAnalyticsEnabled=true
#compilers=r100
#compiler.r100.exe=/mnt/data/apps/rust/bin/rustc
#compiler.r100.name=rustc 1.0.0
#compiler.r100.intelAsm=-Cllvm-args=--x86-asm-syntax=intel
#compileFilename=example.rs
#compileToAsm=--emit asm --crate-type staticlib
#cacheMb=100
#language=C++
#options=-O --crate-type staticlib
#clientGoogleAnalyticsEnabled=true

@ -37,6 +37,12 @@ CodeMirror.defineMode("asm", function () {
};
}
var x86_32regName = /[re]?(ax|bx|cx|dx|si|di|bp|ip|sp)/;
var x86_64regName = /r[\d]+[d]?/;
var x86_xregName = /[xy]mm\d+/;
var x86_keywords = /PTR|BYTE|[DQ]?WORD|XMMWORD|YMMWORD/;
var labelName = /\.L\w+/;
return {
token: function (stream) {
if (stream.match(/^.+:$/)) {
@ -49,6 +55,13 @@ CodeMirror.defineMode("asm", function () {
return "keyword";
}
if (stream.eatSpace()) return null;
if (stream.match(x86_32regName)
|| stream.match(x86_64regName)
|| stream.match(x86_xregName)) {
return "variable-3";
}
if (stream.match(x86_keywords)) return "keyword";
if (stream.match(labelName)) return "variable-2";
var ch = stream.next();
if (ch == '"' || ch == "'") {
return tokenString(ch)(stream);
@ -66,7 +79,6 @@ CodeMirror.defineMode("asm", function () {
stream.eatWhile(/.*/);
return "comment";
}
stream.eatWhile(/[\w\$_]/);
return "word";
}
};

Loading…
Cancel
Save