Coder Social home page Coder Social logo

Comments (5)

klauspost avatar klauspost commented on May 22, 2024

The comment is intended to document what is below. The label is considered "global" and is therefore not indented, and the comment above keeps that indentation. So yes, it is intended.

If you want it indented, it can be moved to after the label

from asmfmt.

mmcloughlin avatar mmcloughlin commented on May 22, 2024

Why does it move the comment before "done" but not the comment before "loop"?

from asmfmt.

mmcloughlin avatar mmcloughlin commented on May 22, 2024

I think this is a minimal example of what I'm asking:

$ cat labelcomments.s
#include "textflag.h"

TEXT ·LabelComments(SB), NOSPLIT, $0-32
	XORQ AX, AX
	// A
a:
	JMP b
	// B
b:
	XORQ AX, AX
$ asmfmt labelcomments.s
#include "textflag.h"

TEXT ·LabelComments(SB), NOSPLIT, $0-32
	XORQ AX, AX

	// A
a:
	JMP b

// B
b:
	XORQ AX, AX

from asmfmt.

klauspost avatar klauspost commented on May 22, 2024

JMP and RET are considered terminators meaning they terminate the block they are in.

Comments are seen as belonging to whatever is following them. Therefore the B is considered as belonging to the b label.

from asmfmt.

mmcloughlin avatar mmcloughlin commented on May 22, 2024

I know what terminator instructions are. It does not seem right to me that they should affect formatting in this way.

Comments are seen as belonging to whatever is following them.

This seems reasonable. Therefore A should belong to the a label also.

Anyway, seems clear that you intended it to work this way, and we just happen to disagree.

from asmfmt.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.