Skip to content

Commit

Permalink
add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongfq committed Jun 15, 2024
1 parent e073675 commit 32d5972
Show file tree
Hide file tree
Showing 9 changed files with 1,253 additions and 1,357 deletions.
124 changes: 124 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@

# see https://github.com/CppCXY/EmmyLuaCodeStyle
[*.lua]
# [basic]

# optional space/tab
indent_style = space
# if indent_style is space, this is valid
indent_size = 4
# if indent_style is tab, this is valid
tab_width = 4
# none/single/double
quote_style = none

continuation_indent = 4

# this mean utf8 length , if this is 'unset' then the line width is no longer checked
# this option decides when to chopdown the code
max_line_length = 120

#optional keep/never/always/smart
trailing_table_separator = keep

# keep/remove/remove_table_only/remove_string_only
call_arg_parentheses = keep

detect_end_of_line = false

# this will check text end with new line
insert_final_newline = true

# [space]
space_around_table_field_list = false

space_before_attribute = true

space_before_function_open_parenthesis = false

space_before_function_call_open_parenthesis = false

space_before_closure_open_parenthesis = true

space_before_function_call_single_arg = true

space_before_open_square_bracket = false

space_inside_function_call_parentheses = false

space_inside_function_param_list_parentheses = false

space_inside_square_brackets = false

# like t[#t+1] = 1
space_around_table_append_operator = true

ignore_spaces_inside_function_call = false

space_before_inline_comment = 1

# [operator space]
# space_around_math_operator = true

# space_after_comma = true

# space_after_comma_in_for_statement = true

# space_around_concat_operator = true

# [align]

# align_call_args = false

# align_function_params = true

# align_continuous_assign_statement = true

# align_continuous_rect_table_field = true

# align_if_branch = true

# align_array_table = true

# [indent]

# never_indent_before_if_condition = false

# never_indent_comment_on_if_branch = false

# [line space]

# The following configuration supports four expressions
# keep
# fixed(n)
# min(n)
# max(n)
# for eg. min(2)

# line_space_after_if_statement = keep

# line_space_after_do_statement = keep

# line_space_after_while_statement = keep

# line_space_after_repeat_statement = keep

# line_space_after_for_statement = keep

# line_space_after_local_or_assign_statement = keep

# line_space_after_function_statement = fixed(2)

# line_space_after_expression_statement = keep

# line_space_after_comment = keep

# [line break]
# break_all_list_when_line_exceed = false

# auto_collapse_lines = false

# [preference]
# ignore_space_after_colon = true

# remove_call_expression_list_finish_comma = false
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ project(luaclang)
# llvm-project/llvm/CMakeLists.txt
set(LLVM_ENABLE_PROJECTS "clang" CACHE STRING "")
set(LLVM_TARGETS_TO_BUILD "" CACHE STRING "")
set(LLVM_ENABLE_ZSTD "OFF" CACHE STRING "")

# llvm-project/clang/tools/libclang/CMakeLists.txt
set(LIBCLANG_BUILD_STATIC ON CACHE BOOL "")
Expand Down
9 changes: 4 additions & 5 deletions conf/lua-clang.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ module 'clang'

path 'src'

metapath 'olua/addons'

headers [[
#include "clang_wrapper.h"
]]

luaopen [[
if (olua_getclass(L, olua_getluatype<clangwrapper::clang>(L))) {
return 1;
}
]]
entry "clangwrapper::clang"

local pattern = {
'^CXGlobalOpt_', '^CXType_', '^CXCursor_', '^CXDiagnostic_', '^CXCallingConv_',
Expand Down Expand Up @@ -38,6 +36,7 @@ luacls(function (cppcls)
end)

typedef 'clangwrapper::string'
.luatype 'string'
.conv 'olua_$$_string'

typeconf 'clangwrapper::Cursor::SourceRange'
Expand Down
2 changes: 1 addition & 1 deletion llvm-project
115 changes: 16 additions & 99 deletions lua-clang.code-workspace
Original file line number Diff line number Diff line change
@@ -1,100 +1,17 @@
{
"folders": [
{
"path": "."
}
],
"settings": {
"cmake.configureOnOpen": false,
"files.associations": {
"*.manifest": "json",
"*.jsfl": "javascript",
"__bit_reference": "cpp",
"__bits": "cpp",
"__config": "cpp",
"__debug": "cpp",
"__errc": "cpp",
"__hash_table": "cpp",
"__locale": "cpp",
"__mutex_base": "cpp",
"__node_handle": "cpp",
"__nullptr": "cpp",
"__split_buffer": "cpp",
"__string": "cpp",
"__threading_support": "cpp",
"__tree": "cpp",
"__tuple": "cpp",
"array": "cpp",
"atomic": "cpp",
"bit": "cpp",
"bitset": "cpp",
"cctype": "cpp",
"cfenv": "cpp",
"charconv": "cpp",
"chrono": "cpp",
"cinttypes": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"compare": "cpp",
"complex": "cpp",
"concepts": "cpp",
"condition_variable": "cpp",
"csignal": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"exception": "cpp",
"forward_list": "cpp",
"fstream": "cpp",
"future": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"ios": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"limits": "cpp",
"list": "cpp",
"locale": "cpp",
"map": "cpp",
"memory": "cpp",
"mutex": "cpp",
"new": "cpp",
"numeric": "cpp",
"optional": "cpp",
"ostream": "cpp",
"queue": "cpp",
"random": "cpp",
"ratio": "cpp",
"regex": "cpp",
"set": "cpp",
"shared_mutex": "cpp",
"sstream": "cpp",
"stack": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"string": "cpp",
"string_view": "cpp",
"strstream": "cpp",
"system_error": "cpp",
"thread": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"typeinfo": "cpp",
"unordered_map": "cpp",
"unordered_set": "cpp",
"variant": "cpp",
"vector": "cpp",
"algorithm": "cpp",
"*.inc": "cpp",
"__verbose_abort": "cpp"
}
}
}
"folders": [
{
"path": "."
}
],
"settings": {
"cmake.configureOnOpen": false,
"editor.formatOnSave": true,
"Lua.workspace.library": ["olua/addons"],
"files.associations": {
"*.jsfl": "javascript",
"*.manifest": "json"
},
"Lua.diagnostics.disable": ["redundant-return-value"]
}
}
2 changes: 1 addition & 1 deletion olua
Submodule olua updated 58 files
+6 −0 addons/clang/config.json
+57 −0 addons/clang/library/clang.lua
+20 −0 addons/clang/library/clang/AvailabilityKind.lua
+14 −0 addons/clang/library/clang/CXXAccessSpecifier.lua
+35 −0 addons/clang/library/clang/CallingConv.lua
+210 −0 addons/clang/library/clang/Cursor.lua
+18 −0 addons/clang/library/clang/Cursor/SourceLocation.lua
+20 −0 addons/clang/library/clang/Cursor/SourceRange.lua
+669 −0 addons/clang/library/clang/CursorKind.lua
+36 −0 addons/clang/library/clang/Diagnostic.lua
+25 −0 addons/clang/library/clang/DiagnosticSeverity.lua
+25 −0 addons/clang/library/clang/File.lua
+27 −0 addons/clang/library/clang/GlobalOptFlags.lua
+42 −0 addons/clang/library/clang/Index.lua
+20 −0 addons/clang/library/clang/IndexError.lua
+14 −0 addons/clang/library/clang/LanguageKind.lua
+23 −0 addons/clang/library/clang/LinkageKind.lua
+18 −0 addons/clang/library/clang/Module.lua
+16 −0 addons/clang/library/clang/RefQualifierKind.lua
+18 −0 addons/clang/library/clang/StorageClass.lua
+13 −0 addons/clang/library/clang/TLSKind.lua
+20 −0 addons/clang/library/clang/TemplateArgumentKind.lua
+56 −0 addons/clang/library/clang/TranslationUnit.lua
+80 −0 addons/clang/library/clang/Type.lua
+142 −0 addons/clang/library/clang/TypeKind.lua
+26 −0 addons/clang/library/clang/TypeNullabilityKind.lua
+19 −0 addons/clang/library/clang/VisibilityKind.lua
+57 −0 addons/olua/library/olua.lua
+2 −1 examples/00-testapi/conf/lua-example.lua
+23 −2 examples/00-testapi/src/Example.h
+1,091 −178 examples/00-testapi/src/lua_example.cpp
+38 −10 examples/00-testapi/src/test.lua
+1 −1 examples/02-callback/src/lua_example.cpp
+1 −1 examples/03-convertor/conf/lua-example.lua
+1 −1 examples/03-convertor/src/Example.h
+2 −2 examples/03-convertor/src/lua_example.cpp
+1 −1 examples/04-reference/conf/lua-example.lua
+8 −8 examples/04-reference/src/lua_example.cpp
+3 −3 examples/05-template/src/lua_example.cpp
+6 −6 examples/05-template/src/test.lua
+1 −1 examples/common/lua-object.lua
+1 −1 examples/common/lua_conv.h
+2,834 −1,365 examples/common/lua_types.cpp
+1 −1 examples/common/luauser.h
+1 −1 examples/common/olua-custom.h
+19 −19 lua-types.lua
+196 −62 olua.c
+14 −104 olua.code-workspace
+26 −18 olua.h
+110 −184 olua.hpp
+152 −68 tools/autoconf.lua
+182 −0 tools/base64.lua
+12 −1 tools/basictype.lua
+3 −1 tools/gen-callback.lua
+211 −3 tools/gen-class.lua
+26 −26 tools/gen-func.lua
+17 −12 tools/init.lua
+53 −34 tools/parser.lua
Loading

0 comments on commit 32d5972

Please sign in to comment.