소스 검색

[std] improve doc formatting for Expr.hx

Jens Fischer 5 년 전
부모
커밋
2e3b8206e2
2개의 변경된 파일23개의 추가작업 그리고 35개의 파일을 삭제
  1. 1 1
      std/Math.hx
  2. 22 34
      std/haxe/macro/Expr.hx

+ 1 - 1
std/Math.hx

@@ -81,7 +81,7 @@ extern class Math {
 	/**
 		Returns the absolute value of `v`.
 
-		- If `v` is positive or `0`, the result is unchanged. Otherwise the result is -`v`.
+		- If `v` is positive or `0`, the result is unchanged. Otherwise the result is `-v`.
 		- If `v` is `NEGATIVE_INFINITY` or `POSITIVE_INFINITY`, the result is `POSITIVE_INFINITY`.
 		- If `v` is `NaN`, the result is `NaN`.
 	**/

+ 22 - 34
std/haxe/macro/Expr.hx

@@ -81,8 +81,9 @@ enum Constant {
 		Represents a regular expression literal.
 
 		Example: `~/haxe/i`
-		* The first argument _haxe_ is a string with regular expression pattern.
-		* The second argument _i_ is a string with regular expression flags.
+
+		- The first argument `haxe` is a string with regular expression pattern.
+		- The second argument `i` is a string with regular expression flags.
 
 		@see https://haxe.org/manual/std-regex.html
 	**/
@@ -195,17 +196,7 @@ enum Binop {
 	OpMod;
 
 	/**
-		`+=`
-		`-=`
-		`/=`
-		`*=`
-		`<<=`
-		`>>=`
-		`>>>=`
-		`|=`
-		`&=`
-		`^=`
-		`%=`
+		`+=` `-=` `/=` `*=` `<<=` `>>=` `>>>=` `|=` `&=` `^=` `%=`
 	**/
 	OpAssignOp(op:Binop);
 
@@ -328,7 +319,7 @@ typedef Var = {
 
 /**
 	Represents a catch in the AST.
-	@https://haxe.org/manual/expression-try-catch.html
+	@see https://haxe.org/manual/expression-try-catch.html
 **/
 typedef Catch = {
 	/**
@@ -390,10 +381,12 @@ enum FunctionKind {
 		Anonymous function
 	**/
 	FAnonymous;
+
 	/**
 		Named function
 	**/
 	FNamed(name:String, ?inlined:Bool);
+
 	/**
 		Arrow function
 	**/
@@ -452,13 +445,13 @@ enum ExprDef {
 	/**
 		An unary operator `op` on `e`:
 
-		* e++ (op = OpIncrement, postFix = true)
-		* e-- (op = OpDecrement, postFix = true)
-		* ++e (op = OpIncrement, postFix = false)
-		* --e (op = OpDecrement, postFix = false)
-		* -e (op = OpNeg, postFix = false)
-		* !e (op = OpNot, postFix = false)
-		* ~e (op = OpNegBits, postFix = false)
+		- `e++` (`op = OpIncrement, postFix = true`)
+		- `e--` (`op = OpDecrement, postFix = true`)
+		- `++e` (`op = OpIncrement, postFix = false`)
+		- `--e` (`op = OpDecrement, postFix = false`)
+		- `-e` (`op = OpNeg, postFix = false`)
+		- `!e` (`op = OpNot, postFix = false`)
+		- `~e` (`op = OpNegBits, postFix = false`)
 	**/
 	EUnop(op:Unop, postFix:Bool, e:Expr);
 
@@ -483,20 +476,22 @@ enum ExprDef {
 	EFor(it:Expr, expr:Expr);
 
 	/**
-		An `if(econd) eif` or `if(econd) eif else eelse` expression.
+		An `if (econd) eif` or `if (econd) eif else eelse` expression.
 	**/
 	EIf(econd:Expr, eif:Expr, eelse:Null<Expr>);
 
 	/**
 		Represents a `while` expression.
+
 		When `normalWhile` is `true` it is `while (...)`.
+
 		When `normalWhile` is `false` it is `do {...} while (...)`.
 	**/
 	EWhile(econd:Expr, e:Expr, normalWhile:Bool);
 
 	/**
 		Represents a `switch` expression with related cases and an optional.
-		`default` case if edef != null.
+		`default` case if `edef != null`.
 	**/
 	ESwitch(e:Expr, cases:Array<Case>, edef:Null<Expr>);
 
@@ -536,12 +531,12 @@ enum ExprDef {
 	ECast(e:Expr, t:Null<ComplexType>);
 
 	/**
-		Internally used to provide completion.
+		Used internally to provide completion.
 	**/
 	EDisplay(e:Expr, displayKind:DisplayKind);
 
 	/**
-		Internally used to provide completion.
+		Used internally to provide completion.
 	**/
 	EDisplayNew(t:TypePath);
 
@@ -640,7 +635,7 @@ typedef TypePath = {
 
 	/**
 		Sub is set on module sub-type access:
-		`pack.Module.Type` has name = Module, sub = Type, if available.
+		`pack.Module.Type` has `name = "Module"`, `sub = "Type"`, if available.
 	**/
 	var ?sub:Null<String>;
 }
@@ -653,14 +648,7 @@ typedef TypePath = {
 	in the normal case it's `TPType`.
 **/
 enum TypeParam {
-	/**
-
-	**/
 	TPType(t:ComplexType);
-
-	/**
-
-	**/
 	TPExpr(e:Expr);
 }
 
@@ -849,7 +837,7 @@ enum Access {
 	AInline;
 
 	/**
-		Macros access modifier. Allows expression macro functions. These are
+		Macro access modifier. Allows expression macro functions. These are
 		normal functions which are executed as soon as they are typed.
 	**/
 	AMacro;