Browse Source

[std] consistently use ```haxe for code blocks in docs

[skip ci]
Jens Fischer 6 years ago
parent
commit
db33df9625

+ 0 - 2
.vscode/tasks.json

@@ -1,6 +1,4 @@
 {
 {
-    // See https://go.microsoft.com/fwlink/?LinkId=733558
-    // for the documentation about the tasks.json format
     "version": "2.0.0",
     "version": "2.0.0",
 	"tasks": [
 	"tasks": [
 		{
 		{

+ 1 - 1
std/StringTools.hx

@@ -531,7 +531,7 @@ class StringTools {
 		http://msdn.microsoft.com/en-us/library/ms880421
 		http://msdn.microsoft.com/en-us/library/ms880421
 
 
 		Examples:
 		Examples:
-		```
+		```haxe
 		quoteWinArg("abc") == "abc";
 		quoteWinArg("abc") == "abc";
 		quoteWinArg("ab c") == '"ab c"';
 		quoteWinArg("ab c") == '"ab c"';
 		```
 		```

+ 2 - 2
std/cs/Flags.hx

@@ -27,8 +27,8 @@
 	Usage example:
 	Usage example:
 
 
 	```haxe
 	```haxe
-		import cs.system.reflection.BindingFlags;
-		var binding = new Flags(BindingFlags.Public) | BindingFlags.Static | BindingFlags.NonPublic;
+	import cs.system.reflection.BindingFlags;
+	var binding = new Flags(BindingFlags.Public) | BindingFlags.Static | BindingFlags.NonPublic;
 	```
 	```
  **/
  **/
 abstract Flags<T : EnumValue>(T) from T to T
 abstract Flags<T : EnumValue>(T) from T to T

+ 15 - 14
std/eval/vm/Context.hx

@@ -35,24 +35,25 @@ extern class Context {
 
 
 		Sample plugin:
 		Sample plugin:
 
 
+		```ocaml
+		open EvalValue
+		open EvalContext
+		open EvalEncode
+
+		let add_int = vfun2 (fun v1 v2 -> match v1,v2 with
+			| VInt32 i1,VInt32 i2 -> vint32 (Int32.add i1 i2)
+			| _ -> exc_string "Expected int + int"
+		)
+		;;
+		EvalStdLib.StdContext.register ["add_int",add_int]
 		```
 		```
-open EvalValue
-open EvalContext
-open EvalEncode
-
-let add_int = vfun2 (fun v1 v2 -> match v1,v2 with
-	| VInt32 i1,VInt32 i2 -> vint32 (Int32.add i1 i2)
-	| _ -> exc_string "Expected int + int"
-)
-;;
-EvalStdLib.StdContext.register ["add_int",add_int]
-```
 
 
 		Usage from Haxe:
 		Usage from Haxe:
 
 
-		```var module:TestPlugin = eval.vm.Context.loadPlugin("testPlugin.cmo");
-trace(module.add_int(4, 3));
-```
+		```haxe
+		var module:TestPlugin = eval.vm.Context.loadPlugin("testPlugin.cmo");
+		trace(module.add_int(4, 3));
+		```
 
 
 		Plugins have to be compiled with the same OCaml version as the Haxe compiler
 		Plugins have to be compiled with the same OCaml version as the Haxe compiler
 		and using the same Haxe version. If a plugin cannot be loaded, an exception
 		and using the same Haxe version. If a plugin cannot be loaded, an exception

+ 1 - 1
std/haxe/macro/ExprTools.hx

@@ -152,7 +152,7 @@ class ExprTools {
 					ExprTools.map(e, capitalizeStrings);
 					ExprTools.map(e, capitalizeStrings);
 			}
 			}
 		}
 		}
-		```haxe
+		```
 	**/
 	**/
 	static public function map( e : Expr, f : Expr -> Expr ) : Expr {
 	static public function map( e : Expr, f : Expr -> Expr ) : Expr {
 		return {pos: e.pos, expr: switch(e.expr) {
 		return {pos: e.pos, expr: switch(e.expr) {

+ 2 - 2
std/js/Syntax.hx

@@ -13,11 +13,11 @@ extern class Syntax {
 		`code` must be a string constant.
 		`code` must be a string constant.
 
 
 		Additional `args` are supported to provide code interpolation, for example:
 		Additional `args` are supported to provide code interpolation, for example:
-		```
+		```haxe
 		Syntax.code("console.log({0}, {1})", "hi", 42);
 		Syntax.code("console.log({0}, {1})", "hi", 42);
 		```
 		```
 		will generate
 		will generate
-		```
+		```haxe
 		console.log("hi", 42);
 		console.log("hi", 42);
 		```
 		```
 	**/
 	**/

+ 1 - 1
std/php/Boot.hx

@@ -490,7 +490,7 @@ class Boot {
 
 
 	/**
 	/**
 		Helper method to avoid "Cannot use temporary expression in write context" error for expressions like this:
 		Helper method to avoid "Cannot use temporary expression in write context" error for expressions like this:
-		```
+		```haxe
 		(new MyClass()).fieldName = 'value';
 		(new MyClass()).fieldName = 'value';
 		```
 		```
 	**/
 	**/

+ 1 - 1
std/php/Generator.hx

@@ -6,7 +6,7 @@ package php;
 	Generator is not a Haxe Iterable. It can be iterated one time only.
 	Generator is not a Haxe Iterable. It can be iterated one time only.
 	Unfortunately Haxe does not know that in PHP generators may have no `return` expression or `return value` with any type of `value`.
 	Unfortunately Haxe does not know that in PHP generators may have no `return` expression or `return value` with any type of `value`.
 	Use `return null` or untyped cast to workaround this issue:
 	Use `return null` or untyped cast to workaround this issue:
-	```
+	```haxe
 	function generatorWithoutReturn():Generator {
 	function generatorWithoutReturn():Generator {
 		php.Syntax.yield(1);
 		php.Syntax.yield(1);
 		return null;
 		return null;

+ 9 - 9
std/php/Syntax.hx

@@ -15,11 +15,11 @@ extern class Syntax {
         `php` should be a string literal with php code.
         `php` should be a string literal with php code.
         It can contain placeholders like `{0}`, `{1}` which will be replaced with corresponding arguments from `args`.
         It can contain placeholders like `{0}`, `{1}` which will be replaced with corresponding arguments from `args`.
         E.g.:
         E.g.:
-        ```
+        ```haxe
         Syntax.code("var_dump({0}, {1})", a, b);
         Syntax.code("var_dump({0}, {1})", a, b);
         ```
         ```
         will generate
         will generate
-        ```
+        ```haxe
         var_dump($a, $b);
         var_dump($a, $b);
         ```
         ```
     **/
     **/
@@ -172,18 +172,18 @@ extern class Syntax {
 
 
     /**
     /**
         Generates PHP class name for a provided Haxe class.
         Generates PHP class name for a provided Haxe class.
-        ```
+        ```haxe
         trace(Syntax.nativeClassName(php.Web)); // outputs: php\Web
         trace(Syntax.nativeClassName(php.Web)); // outputs: php\Web
         ```
         ```
      */
      */
     static function nativeClassName<T>(cls:EitherType<Class<T>, Enum<T>>) : String;
     static function nativeClassName<T>(cls:EitherType<Class<T>, Enum<T>>) : String;
 
 
     /**
     /**
-        ```
+        ```haxe
         Syntax.foreach(collection, function(key, value) trace(key, value));
         Syntax.foreach(collection, function(key, value) trace(key, value));
         ```
         ```
         generates:
         generates:
-        ```
+        ```haxe
         foreach($collection as $key => $value) {
         foreach($collection as $key => $value) {
             trace($key, $value);
             trace($key, $value);
         }
         }
@@ -245,22 +245,22 @@ extern class Syntax {
     static function staticCall( className:AsVar<EitherType<Class<Dynamic>,String>>, methodName:String, args:Rest<Dynamic> ) : Dynamic;
     static function staticCall( className:AsVar<EitherType<Class<Dynamic>,String>>, methodName:String, args:Rest<Dynamic> ) : Dynamic;
 
 
     /**
     /**
-        ```
+        ```haxe
         Syntax.arrayDecl(arg1, arg2, arg3);
         Syntax.arrayDecl(arg1, arg2, arg3);
         ```
         ```
         Generates native array declaration:
         Generates native array declaration:
-        ```
+        ```haxe
         [$arg1, $arg2, $arg3]
         [$arg1, $arg2, $arg3]
         ```
         ```
     **/
     **/
     static function arrayDecl<T>( args:Rest<T> ) : NativeIndexedArray<T>;
     static function arrayDecl<T>( args:Rest<T> ) : NativeIndexedArray<T>;
 
 
     /**
     /**
-        ```
+        ```haxe
         Syntax.assocDecl({field1:'first', field2:2}});
         Syntax.assocDecl({field1:'first', field2:2}});
         ```
         ```
         Generates native associative array declaration:
         Generates native associative array declaration:
-        ```
+        ```haxe
         ["field1" => "first", "field2" => 2];
         ["field1" => "first", "field2" => 2];
         ```
         ```
         This method is not recursive.
         This method is not recursive.

+ 1 - 1
std/php/_std/StringTools.hx

@@ -153,7 +153,7 @@ import php.*;
 		http://msdn.microsoft.com/en-us/library/ms880421
 		http://msdn.microsoft.com/en-us/library/ms880421
 
 
 		Examples:
 		Examples:
-		```
+		```haxe
 		quoteWinArg("abc") == "abc";
 		quoteWinArg("abc") == "abc";
 		quoteWinArg("ab c") == '"ab c"';
 		quoteWinArg("ab c") == '"ab c"';
 		```
 		```

+ 1 - 1
tests/nullsafety/src/cases/Test.hx

@@ -80,7 +80,7 @@ class AllVarsInitializedInConstructor_weHaveClosure_thisShouldBeUsable {
 
 
 	/**
 	/**
 	 * This is generated like:
 	 * This is generated like:
-	 * ```
+	 * ```haxe
 	 * var _gthis = this; //problems come from here
 	 * var _gthis = this; //problems come from here
 	 * this.v = 42;
 	 * this.v = 42;
 	 * var f = function() {
 	 * var f = function() {