-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
399 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package errgoengine | ||
|
||
import ( | ||
"fmt" | ||
"io/fs" | ||
) | ||
|
||
type ExternSymbol struct { | ||
Name string `json:"name"` | ||
Type string `json:"type"` | ||
ReturnType string `json:"returnType"` | ||
Paremeters []ExternSymbol `json:"parameters"` | ||
} | ||
|
||
type ExternFile struct { | ||
Name string `json:"name"` | ||
Package string `json:"package"` | ||
Constructors []ExternSymbol `json:"constructors"` | ||
Methods []ExternSymbol `json:"methods"` | ||
} | ||
|
||
func ImportExternSymbols(externFs fs.ReadFileFS) (map[string]*SymbolTree, error) { | ||
if externFs == nil { | ||
return nil, nil | ||
} | ||
|
||
symbols := make(map[string]*SymbolTree) | ||
matches, err := fs.Glob(externFs, "**/*.json") | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
for _, match := range matches { | ||
if err := compileExternSymbol(externFs, match); err != nil { | ||
return symbols, err | ||
} | ||
} | ||
|
||
return symbols, nil | ||
} | ||
|
||
func compileExternSymbol(externFs fs.FS, path string) error { | ||
if externFs == nil { | ||
return fmt.Errorf("externFs must not be nil") | ||
} | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"name": "Object", | ||
"package": "java.lang", | ||
"description": "The root class of the Java class hierarchy.", | ||
"constructors": [ | ||
{ | ||
"name": "Object", | ||
"parameters": [], | ||
"description": "Creates a new instance of the Object class." | ||
} | ||
], | ||
"methods": [ | ||
{ | ||
"name": "equals", | ||
"returnType": "boolean", | ||
"parameters": [ | ||
{ | ||
"name": "obj", | ||
"type": "Object", | ||
"description": "The object to compare to." | ||
} | ||
], | ||
"description": "Indicates whether some other object is \"equal to\" this one." | ||
}, | ||
{ | ||
"name": "hashCode", | ||
"returnType": "int", | ||
"parameters": [], | ||
"description": "Returns a hash code value for this object." | ||
}, | ||
{ | ||
"name": "toString", | ||
"returnType": "String", | ||
"parameters": [], | ||
"description": "Returns a string representation of this object." | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
{ | ||
"name": "String", | ||
"package": "java.lang", | ||
"description": "Represents a sequence of characters.", | ||
"constructors": [ | ||
{ | ||
"name": "String", | ||
"parameters": [ | ||
{ | ||
"name": "value", | ||
"type": "char[]", | ||
"description": "The character array that is the initial value of the string." | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "String", | ||
"parameters": [ | ||
{ | ||
"name": "value", | ||
"type": "String", | ||
"description": "The string that is the initial value of the string." | ||
} | ||
] | ||
} | ||
], | ||
"methods": [ | ||
{ | ||
"name": "length", | ||
"returnType": "int", | ||
"description": "Returns the length of the string." | ||
}, | ||
{ | ||
"name": "charAt", | ||
"returnType": "char", | ||
"parameters": [ | ||
{ | ||
"name": "index", | ||
"type": "int", | ||
"description": "The index of the character to return." | ||
} | ||
], | ||
"description": "Returns the character at the specified index." | ||
}, | ||
{ | ||
"name": "substring", | ||
"returnType": "String", | ||
"parameters": [ | ||
{ | ||
"name": "start", | ||
"type": "int", | ||
"description": "The starting index of the substring." | ||
}, | ||
{ | ||
"name": "end", | ||
"type": "int", | ||
"description": "The ending index of the substring." | ||
} | ||
], | ||
"description": "Returns a substring of the string." | ||
}, | ||
{ | ||
"name": "concat", | ||
"returnType": "String", | ||
"parameters": [ | ||
{ | ||
"name": "str", | ||
"type": "String", | ||
"description": "The string to concatenate." | ||
} | ||
], | ||
"description": "Concatenates the specified string to the end of this string." | ||
}, | ||
{ | ||
"name": "equals", | ||
"returnType": "boolean", | ||
"parameters": [ | ||
{ | ||
"name": "obj", | ||
"type": "Object", | ||
"description": "The object to compare to." | ||
} | ||
], | ||
"description": "Compares this string to the specified object." | ||
}, | ||
{ | ||
"name": "hashCode", | ||
"returnType": "int", | ||
"description": "Returns the hash code of this string." | ||
}, | ||
{ | ||
"name": "toString", | ||
"returnType": "String", | ||
"description": "Returns a string representation of this string." | ||
} | ||
] | ||
} |
Oops, something went wrong.