;;;;;
;
; Test that commas create empty macro arguments.
;
        .macro  tstarg a1,a2,a3,a4
        .narg   label
        .endm

start:  tstarg          ; 0 args
        tstarg   123    ; 1 arg
        tstarg   1,     ; 2 args
        tstarg   ,2     ; 2 args
        tstarg   ,      ; 2 args
        tstarg   ,,     ; 3 args
        tstarg   1,,    ; 3 args
        tstarg   ,,3    ; 3 args
        tstarg   1,,3   ; 3 args
        tstarg   1,2,3  ; 3 args

;;;;;
;
; Test what happens if we have invalid bracketed strings.
; For now we fall back to treating them like unbracketed strings,
; that will hopefully alert the user the best.
;
        .macro  braket  arg
        ; arg
        .endm

        braket  <plain>
        braket  ^/simple/
        braket  <broken
        braket  ^/broken
        braket  <bro<ken>
        braket  <bro<ken> string

;
; Test that commas work with default arguments
;
        .macro  tstarg a1,a2=default,a3,a4
        .narg   label	; second arg is "a2"
        .endm

start:  tstarg          ; 0 args
        tstarg   123    ; 1 arg
        tstarg   1,     ; 2 args
        tstarg   ,2     ; 2 args
        tstarg   ,      ; 2 args
        tstarg   ,,     ; 3 args
        tstarg   1,,    ; 3 args
        tstarg   ,,3    ; 3 args
        tstarg   1,,3   ; 3 args
        tstarg   1,2,3  ; 3 args

;
; Test default args and strange commas
;
	.macro	tstdef	a=1,b=2
	.word	a,b
	.endm

	tstdef
	tstdef	4,5
	tstdef	4,5,6		; Excess argument is ignored
	tstdef	b=42
	tstdef	a=73
	tstdef	,b=11
	tstdef	a=5,b=4
	tstdef	,a=5,b=4	; Strange case seen in some sources
	tstdef	a=5,a=4		; Duplicate keyword argument -- legal!
