|
From: Greg D. <gre...@in...> - 2019-05-24 02:45:20
|
I was able to build a mode called "M11" which worked satisfactorily - however, it's been a long time since I wrote more than a few lines of Tcl so I'm
sure I'm missing one of the syntax behaviors. The standard opcode keywords are properly highlighted; however, I was trying to add text coloring for
the assembler directives and it's not working:
# List of keywords
set M11KeyWords {
HALT WAIT RTI BPT IOT RESET RTT JMP RTS SPL NOP SWAB BR BNE BEQ BGE
BLT BGT BLE JSR CLR COM INC DEC NEG ADC SBC TST ROR ROL ASR ASL MARK
MFPI MTPI SXT MOV CMP BIT BIC BIS ADD MUL DIV ASH ASHC XOR FADD FSUB
FMUL FDIV SOB BPL BMI BHI BLOS BVC BVS BCC BHIS BCS BLO EMT TRAP CLRB
COMB INCB DECB NEGB ADCB SBCB TSTB RORB ROLB ASRB ASLB MFPD MTPD MOVB
CMPB BITB BICB BISB SUB
}
set M11Directives {
.BYTE .WORD .MACRO .LIST .BLKB .BLKW .END .ENDM .PRINT
}
# Colour the keywords, comments etc.
modeColoring register keywords M11 [colors::named blue] $M11KeyWords
# Discard the list
unset M11KeyWords
modeColoring register keywords M11 [colors::named green] $M11Directives
# Discard the list
unset M11Directives
I suspect that the code is not parsing the directives correctly because of the leading '.' character, but I was unable to resolve it.
Also, I was unable to get Alpha to set tab size for the mode by changing 'tabsize'. Is that not the preferred way of changing it within a mode
definition?
On 5/23/19 12:51 AM, Bernard Desgraupes wrote:
> Hi Greg,
>
> to my knowledge, there is no mode around to edit assembly code with Alpha. It should not be difficult to create a mode for this purpose. I’m ready to assist if you decide to go this way.
>
> Cheers,
> Bernard
>
>> Le 22 mai 2019 à 21:36, Greg Dunn <gre...@in...> a écrit :
>>
>> As a fun side project, I'm playing with a PDP-11 simulator and will eventually want to write some MACRO-11 assembly. Has anyone written a mode which specifically does parsing and coloration for assembly language? If not, it shouldn't take long to put one together, but I thought perhaps someone had already looked into it and might have mode settings to share which I could adapt.
>>
>> --
>> | Greg Dunn | People are so conditioned to take |
>> | gre...@in... | sides that a balanced analysis |
>> | The Sultan of Slack(tm) | looks to them like hatred. |
>> | http://www.indy.net/~gregdunn/ | Scott Adams |
>>
>>
>> _______________________________________________
>> AlphaCocoa-devel mailing list
>> Alp...@li...
>> https://lists.sourceforge.net/lists/listinfo/alphacocoa-devel
>
>
--
| Greg Dunn | I'll never live the life that |
| gre...@in... | wakes me in the night... |
| The Sultan of Slack(tm) | |
| http://www.indy.net/~gregdunn/ | Fiona Apple |
|