Pārlūkot izejas kodu

[std] improve doc formatting for Expr.hx

Jens Fischer 5 gadi atpakaļ
vecāks
revīzija
2e3b8206e2
2 mainītis faili ar 23 papildinājumiem un 35 dzēšanām
  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`.
 		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 `NEGATIVE_INFINITY` or `POSITIVE_INFINITY`, the result is `POSITIVE_INFINITY`.
 		- If `v` is `NaN`, the result is `NaN`.
 		- 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.
 		Represents a regular expression literal.
 
 
 		Example: `~/haxe/i`
 		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
 		@see https://haxe.org/manual/std-regex.html
 	**/
 	**/
@@ -195,17 +196,7 @@ enum Binop {
 	OpMod;
 	OpMod;
 
 
 	/**
 	/**
-		`+=`
-		`-=`
-		`/=`
-		`*=`
-		`<<=`
-		`>>=`
-		`>>>=`
-		`|=`
-		`&=`
-		`^=`
-		`%=`
+		`+=` `-=` `/=` `*=` `<<=` `>>=` `>>>=` `|=` `&=` `^=` `%=`
 	**/
 	**/
 	OpAssignOp(op:Binop);
 	OpAssignOp(op:Binop);
 
 
@@ -328,7 +319,7 @@ typedef Var = {
 
 
 /**
 /**
 	Represents a catch in the AST.
 	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 = {
 typedef Catch = {
 	/**
 	/**
@@ -390,10 +381,12 @@ enum FunctionKind {
 		Anonymous function
 		Anonymous function
 	**/
 	**/
 	FAnonymous;
 	FAnonymous;
+
 	/**
 	/**
 		Named function
 		Named function
 	**/
 	**/
 	FNamed(name:String, ?inlined:Bool);
 	FNamed(name:String, ?inlined:Bool);
+
 	/**
 	/**
 		Arrow function
 		Arrow function
 	**/
 	**/
@@ -452,13 +445,13 @@ enum ExprDef {
 	/**
 	/**
 		An unary operator `op` on `e`:
 		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);
 	EUnop(op:Unop, postFix:Bool, e:Expr);
 
 
@@ -483,20 +476,22 @@ enum ExprDef {
 	EFor(it:Expr, expr:Expr);
 	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>);
 	EIf(econd:Expr, eif:Expr, eelse:Null<Expr>);
 
 
 	/**
 	/**
 		Represents a `while` expression.
 		Represents a `while` expression.
+
 		When `normalWhile` is `true` it is `while (...)`.
 		When `normalWhile` is `true` it is `while (...)`.
+
 		When `normalWhile` is `false` it is `do {...} while (...)`.
 		When `normalWhile` is `false` it is `do {...} while (...)`.
 	**/
 	**/
 	EWhile(econd:Expr, e:Expr, normalWhile:Bool);
 	EWhile(econd:Expr, e:Expr, normalWhile:Bool);
 
 
 	/**
 	/**
 		Represents a `switch` expression with related cases and an optional.
 		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>);
 	ESwitch(e:Expr, cases:Array<Case>, edef:Null<Expr>);
 
 
@@ -536,12 +531,12 @@ enum ExprDef {
 	ECast(e:Expr, t:Null<ComplexType>);
 	ECast(e:Expr, t:Null<ComplexType>);
 
 
 	/**
 	/**
-		Internally used to provide completion.
+		Used internally to provide completion.
 	**/
 	**/
 	EDisplay(e:Expr, displayKind:DisplayKind);
 	EDisplay(e:Expr, displayKind:DisplayKind);
 
 
 	/**
 	/**
-		Internally used to provide completion.
+		Used internally to provide completion.
 	**/
 	**/
 	EDisplayNew(t:TypePath);
 	EDisplayNew(t:TypePath);
 
 
@@ -640,7 +635,7 @@ typedef TypePath = {
 
 
 	/**
 	/**
 		Sub is set on module sub-type access:
 		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>;
 	var ?sub:Null<String>;
 }
 }
@@ -653,14 +648,7 @@ typedef TypePath = {
 	in the normal case it's `TPType`.
 	in the normal case it's `TPType`.
 **/
 **/
 enum TypeParam {
 enum TypeParam {
-	/**
-
-	**/
 	TPType(t:ComplexType);
 	TPType(t:ComplexType);
-
-	/**
-
-	**/
 	TPExpr(e:Expr);
 	TPExpr(e:Expr);
 }
 }
 
 
@@ -849,7 +837,7 @@ enum Access {
 	AInline;
 	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.
 		normal functions which are executed as soon as they are typed.
 	**/
 	**/
 	AMacro;
 	AMacro;