comments, skip empty semis in blocks
This commit is contained in:
parent
e79af01925
commit
1201a6c45a
|
|
@ -658,6 +658,13 @@ parse_block:
|
|||
call peek_expect_token
|
||||
test rax, rax
|
||||
jnz .done
|
||||
|
||||
; skip semicolons
|
||||
mov dil, TOKEN_SEMI
|
||||
call expect_token
|
||||
test rax, rax
|
||||
jnz .loop
|
||||
|
||||
mov rdi, [rsp + 56] ; Ast
|
||||
call parse_statement
|
||||
lea rdi, [rsp + 8] ; vec
|
||||
|
|
|
|||
|
|
@ -547,7 +547,8 @@ expect_token:
|
|||
add rsp, 0x30
|
||||
pop rbp
|
||||
ret
|
||||
|
||||
|
||||
;; Returns the next token if it matches the expected token, else panics
|
||||
;; dil: expected token
|
||||
unwrap_token:
|
||||
push rbp
|
||||
|
|
@ -561,6 +562,7 @@ unwrap_token:
|
|||
call panic
|
||||
|
||||
;; returns 0 if token not found, else returns lexeme (ptr, len)
|
||||
;; doesn't advance the cursor
|
||||
;; dil: expected token
|
||||
peek_expect_token:
|
||||
push rbp
|
||||
|
|
@ -573,6 +575,7 @@ peek_expect_token:
|
|||
pop rbp
|
||||
ret
|
||||
|
||||
;; returns the next lexeme without advancing the cursor
|
||||
;; rdi: out-struct pointer
|
||||
peek_lexeme:
|
||||
push rbp
|
||||
|
|
|
|||
Loading…
Reference in a new issue