From 5918946feb64b5fcb83c85a246182d06d84b8e35 Mon Sep 17 00:00:00 2001 From: Alexey Date: Mon, 24 Feb 2020 19:18:14 +0300 Subject: [PATCH] fmt: process attributes --- vlib/v/fmt/fmt.v | 3 +++ vlib/v/fmt/tests/simple_expected.vv | 1 + vlib/v/fmt/tests/simple_input.vv | 2 ++ 3 files changed, 6 insertions(+) diff --git a/vlib/v/fmt/fmt.v b/vlib/v/fmt/fmt.v index e82f5ec3b5..056c65a7a4 100644 --- a/vlib/v/fmt/fmt.v +++ b/vlib/v/fmt/fmt.v @@ -112,6 +112,9 @@ fn (f mut Fmt) stmt(node ast.Stmt) { } f.writeln('') } + ast.Attr { + f.writeln('[$it.name]') + } ast.BranchStmt { match it.tok.kind { .key_break { diff --git a/vlib/v/fmt/tests/simple_expected.vv b/vlib/v/fmt/tests/simple_expected.vv index 08564e8cb3..3ce076e335 100644 --- a/vlib/v/fmt/tests/simple_expected.vv +++ b/vlib/v/fmt/tests/simple_expected.vv @@ -41,6 +41,7 @@ fn new_user() User { } } +[inline] fn fn_contains_range_expr() { a := 1 in arr[0..2] } diff --git a/vlib/v/fmt/tests/simple_input.vv b/vlib/v/fmt/tests/simple_input.vv index 72969af6f4..f5b1ceebc3 100644 --- a/vlib/v/fmt/tests/simple_input.vv +++ b/vlib/v/fmt/tests/simple_input.vv @@ -45,6 +45,8 @@ User } } + +[inline] fn fn_contains_range_expr() { a:=1 in arr[0..2] }