Formatting updates

This commit is contained in:
Jason Turner 2017-12-16 10:21:02 -07:00
parent e78f8a73f9
commit 6c18c64270
2 changed files with 35 additions and 44 deletions

View File

@ -1,59 +1,56 @@
IndentWidth: 2
UseTab: Never
AccessModifierOffset: -2 AccessModifierOffset: -2
AlignAfterOpenBracket: DontAlign AlignAfterOpenBracket: DontAlign
AlignConsecutiveAssignments: false AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left AlignEscapedNewlines: Left
AlignOperands: false AlignOperands: true
AlignTrailingComments: false AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: true AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: true AllowShortBlocksOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: false AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: true AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: false AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: TopLevelDefinitions AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: true AlwaysBreakTemplateDeclarations: false
BinPackArguments: true BinPackArguments: false
BinPackParameters: true BinPackParameters: false
BraceWrapping: BraceWrapping:
AfterClass: false AfterClass: true
AfterControlStatement: false AfterControlStatement: false
AfterEnum: false AfterEnum: false
AfterFunction: true AfterFunction: true
AfterNamespace: false AfterNamespace: false
AfterObjCDeclaration: false AfterObjCDeclaration: false
AfterStruct: false AfterStruct: true
AfterUnion: false AfterUnion: false
BeforeCatch: false BeforeCatch: false
BeforeElse: false BeforeElse: false
IndentBraces: false IndentBraces: false
SplitEmptyFunction: true SplitEmptyFunction: false
SplitEmptyNamespace: true SplitEmptyNamespace: true
SplitEmptyRecord: true SplitEmptyRecord: true
BreakAfterJavaFieldAnnotations: false BreakAfterJavaFieldAnnotations: true
BreakBeforeBinaryOperators: All BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Allman BreakBeforeBraces: Custom
BreakBeforeInheritanceComma: true BreakBeforeInheritanceComma: true
BreakBeforeTernaryOperators: false BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeComma BreakConstructorInitializers: BeforeColon
BreakConstructorInitializersBeforeComma: true BreakConstructorInitializersBeforeComma: false
BreakStringLiterals: true BreakStringLiterals: true
ColumnLimit: 0 ColumnLimit: 0
CommentPragmas: '^ IWYU pragma:' CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: true CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 5 ConstructorInitializerIndentWidth: 2
ContinuationIndentWidth: 2 ContinuationIndentWidth: 2
Cpp11BracedListStyle: false Cpp11BracedListStyle: false
DerivePointerAlignment: true DerivePointerAlignment: true
DisableFormat: false DisableFormat: false
ExperimentalAutoDetectBinPacking: true ExperimentalAutoDetectBinPacking: true
FixNamespaceComments: false FixNamespaceComments: true
ForEachMacros: ForEachMacros:
- foreach - foreach
- Q_FOREACH - Q_FOREACH
@ -67,38 +64,32 @@ IncludeCategories:
Regex: .* Regex: .*
IncludeIsMainRegex: (Test)?$ IncludeIsMainRegex: (Test)?$
IndentCaseLabels: false IndentCaseLabels: false
IndentWrappedFunctionNames: false IndentWidth: 2
JavaScriptQuotes: Single IndentWrappedFunctionNames: true
JavaScriptWrapImports: false JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true KeepEmptyLinesAtTheStartOfBlocks: true
Language: Cpp Language: Cpp
MacroBlockBegin: '' MacroBlockBegin: ''
MacroBlockEnd: '' MacroBlockEnd: ''
MaxEmptyLinesToKeep: 2 MaxEmptyLinesToKeep: 2
NamespaceIndentation: Inner NamespaceIndentation: Inner
ObjCBlockIndentWidth: 4 ObjCBlockIndentWidth: 7
ObjCSpaceAfterProperty: true ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: false ObjCSpaceBeforeProtocolList: false
PenaltyBreakAssignment: 2 PointerAlignment: Right
PenaltyBreakBeforeFirstCallParameter: 23
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 104
PenaltyBreakString: 916
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 80
PointerAlignment: Left
ReflowComments: true ReflowComments: true
SortIncludes: false SortIncludes: false
SortUsingDeclarations: false SortUsingDeclarations: false
SpaceAfterCStyleCast: true SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: false SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1 SpacesBeforeTrailingComments: 0
SpacesInAngles: false SpacesInAngles: false
SpacesInCStyleCastParentheses: false SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false SpacesInContainerLiterals: true
SpacesInParentheses: false SpacesInParentheses: false
SpacesInSquareBrackets: false SpacesInSquareBrackets: false
Standard: Cpp11 Standard: Cpp11

View File

@ -5,7 +5,7 @@ ChaiScript tries to follow the [Semantic Versioning](http://semver.org/) scheme.
* Major Version Number: API changes / breaking changes * Major Version Number: API changes / breaking changes
* Minor Version Number: New Features * Minor Version Number: New Features
* Patch Version Number: Minor changes / enhancements * Patch Version Number: Minor changes / enhancements
# Initializing ChaiScript # Initializing ChaiScript
@ -37,7 +37,7 @@ chai.add(chaiscript::fun(&Class::method_name, Class_instance_ptr), "method_name"
chai.add(chaiscript::fun(&Class::member_name, Class_instance_ptr), "member_name"); chai.add(chaiscript::fun(&Class::member_name, Class_instance_ptr), "member_name");
``` ```
### With Overloads ### With Overloads
#### Preferred #### Preferred
@ -69,9 +69,9 @@ chai.add(chaiscript::fun(static_cast<int(Derived::*)>(&Derived::data)), "data");
``` ```
chai.add( chai.add(
chaiscript::fun<std::string (bool)>( chaiscript::fun<std::string (bool)>(
[](bool type) { [](bool type) {
if (type) { return "x"; } if (type) { return "x"; }
else { return "y"; } else { return "y"; }
}), "function_name"); }), "function_name");
``` ```
@ -168,7 +168,7 @@ chai.set_global(chaiscript::var(somevar), "somevar"); // global non-const, overw
## Adding Namespaces ## Adding Namespaces
Namespaces will not be populated until `import` is called. Namespaces will not be populated until `import` is called.
This saves memory and computing costs if a namespace is not imported into every ChaiScript instance. This saves memory and computing costs if a namespace is not imported into every ChaiScript instance.
``` ```
chai.register_namespace([](chaiscript::Namespace& math) { chai.register_namespace([](chaiscript::Namespace& math) {