;SYNTAX TEST "Packages/dfasm/dfasm.sublime-syntax" ; Test comment ; <- comment.line.semicolon.dfasm ; Test pragma @system pe=4, sm=1 ; <- keyword.control.pragma.dfasm ;^^^^^^ keyword.control.pragma.dfasm ; ^^ variable.parameter.dfasm ; ^ keyword.operator.assignment.dfasm ; ^ constant.numeric.dfasm ; Test data definition with placement and port @val|sm0:5 = 0x42 ; <- punctuation.definition.reference.node.dfasm ;^^^ entity.name.tag.dfasm ; ^ punctuation.separator.placement.dfasm ; ^^^ entity.other.attribute-name.placement.dfasm ; ^ punctuation.separator.port.dfasm ; ^ constant.numeric.port.dfasm ; ^ keyword.operator.assignment.dfasm ; ^^^^ constant.numeric.dfasm ; Test instruction definition with label &c1|pe0 <| const, 3 ; <- punctuation.definition.reference.label.dfasm ;^^ entity.name.label.dfasm ; ^ punctuation.separator.placement.dfasm ; ^^^ entity.other.attribute-name.placement.dfasm ; ^^ keyword.operator.flow.in.dfasm ; ^^^^^ keyword.other.opcode.dfasm ; ^ punctuation.separator.dfasm ; ^ constant.numeric.dfasm ; Test named argument &serial|pe0 <| ior, dest=0x45 ; ^^^^ variable.parameter.dfasm ; ^ keyword.operator.assignment.dfasm ; ^^^^ constant.numeric.dfasm ; Test plain edge with flow operators &a|pe0 |> &b:L ; ^^ keyword.operator.flow.out.dfasm ; ^ punctuation.definition.reference.label.dfasm ; ^ entity.name.label.dfasm ; ^ punctuation.separator.port.dfasm ; ^ entity.other.attribute-name.port.dfasm ; Test function definition $fib |> { ; <- punctuation.definition.reference.function.dfasm ;^^^ entity.name.function.dfasm ; ^^ keyword.operator.flow.out.dfasm ; ^ punctuation.section.block.dfasm &n <| const, 10 ; ^ punctuation.definition.reference.label.dfasm ; ^ entity.name.label.dfasm ; ^^ keyword.operator.flow.in.dfasm ; ^^^^^ keyword.other.opcode.dfasm ; ^^ constant.numeric.dfasm } ; <- punctuation.section.block.dfasm ; Test regular string with escape sequence @hello = #str "hello\n" ; ^ punctuation.definition.macro.dfasm ; ^^^ entity.name.function.macro.dfasm ; ^ string.quoted.double.dfasm ; ^^ constant.character.escape.dfasm ; Test raw string (no escape processing) @path = r"no\escapes" ; ^^ storage.type.string.dfasm ; Test byte string with hex escape @raw = b"\x01" ; ^^ storage.type.string.dfasm ; Test character literal 'h' ; <- string.quoted.single.dfasm ; Test arithmetic opcodes &op_add <| add ; ^^^ keyword.other.opcode.dfasm &op_sub <| sub ; ^^^ keyword.other.opcode.dfasm &op_inc <| inc ; ^^^ keyword.other.opcode.dfasm &op_dec <| dec ; ^^^ keyword.other.opcode.dfasm &op_shiftl <| shiftl ; ^^^^^^ keyword.other.opcode.dfasm &op_shiftr <| shiftr ; ^^^^^^ keyword.other.opcode.dfasm &op_ashiftr <| ashiftr ; ^^^^^^^ keyword.other.opcode.dfasm ; Test logic opcodes &op_and <| and ; ^^^ keyword.other.opcode.dfasm &op_or <| or ; ^^ keyword.other.opcode.dfasm &op_xor <| xor ; ^^^ keyword.other.opcode.dfasm &op_not <| not ; ^^^ keyword.other.opcode.dfasm &op_eq <| eq ; ^^ keyword.other.opcode.dfasm &op_lt <| lt ; ^^ keyword.other.opcode.dfasm &op_lte <| lte ; ^^^ keyword.other.opcode.dfasm &op_gt <| gt ; ^^ keyword.other.opcode.dfasm &op_gte <| gte ; ^^^ keyword.other.opcode.dfasm ; Test branch opcodes &op_breq <| breq ; ^^^^ keyword.other.opcode.dfasm &op_brgt <| brgt ; ^^^^ keyword.other.opcode.dfasm &op_brge <| brge ; ^^^^ keyword.other.opcode.dfasm &op_brof <| brof ; ^^^^ keyword.other.opcode.dfasm &op_brty <| brty ; ^^^^ keyword.other.opcode.dfasm ; Test switch opcodes &op_sweq <| sweq ; ^^^^ keyword.other.opcode.dfasm &op_swgt <| swgt ; ^^^^ keyword.other.opcode.dfasm &op_swge <| swge ; ^^^^ keyword.other.opcode.dfasm &op_swof <| swof ; ^^^^ keyword.other.opcode.dfasm &op_swty <| swty ; ^^^^ keyword.other.opcode.dfasm ; Test routing opcodes &op_gate <| gate ; ^^^^ keyword.other.opcode.dfasm &op_sel <| sel ; ^^^ keyword.other.opcode.dfasm &op_merge <| merge ; ^^^^^ keyword.other.opcode.dfasm &op_pass <| pass ; ^^^^ keyword.other.opcode.dfasm &op_const <| const, 0 ; ^^^^^ keyword.other.opcode.dfasm &op_free_ctx <| free_ctx ; ^^^^^^^^ keyword.other.opcode.dfasm ; Test memory opcodes &op_read <| read ; ^^^^ keyword.other.opcode.dfasm &op_write <| write ; ^^^^^ keyword.other.opcode.dfasm &op_clear <| clear ; ^^^^^ keyword.other.opcode.dfasm &op_alloc <| alloc ; ^^^^^ keyword.other.opcode.dfasm &op_free <| free ; ^^^^ keyword.other.opcode.dfasm &op_rd_inc <| rd_inc ; ^^^^^^ keyword.other.opcode.dfasm &op_rd_dec <| rd_dec ; ^^^^^^ keyword.other.opcode.dfasm &op_cmp_sw <| cmp_sw ; ^^^^^^ keyword.other.opcode.dfasm ; Test IO opcodes &op_ior <| ior ; ^^^ keyword.other.opcode.dfasm &op_iow <| iow ; ^^^ keyword.other.opcode.dfasm &op_iorw <| iorw ; ^^^^ keyword.other.opcode.dfasm ; Test system opcodes &op_load <| load_inst ; ^^^^^^^^^ keyword.other.opcode.dfasm &op_route <| route_set ; ^^^^^^^^^ keyword.other.opcode.dfasm ; Test hex literal in data definition @data_hex = 0xDEADBEEF ; ^^^^^^^^^^ constant.numeric.dfasm ; Test multiple data values @data = 1, 2, 3 ; ^ constant.numeric.dfasm ; ^ constant.numeric.dfasm ; ^ constant.numeric.dfasm ; Test hex in port position &node|pe0:0x10 |> &dest ; ^^^^ constant.numeric.port.dfasm