Skip to content

Commit d322122

Browse files
committed
Remove import functionality
This has been superseded by action definitions and has yet to be used.
1 parent 7a0d3e9 commit d322122

File tree

3 files changed

+0
-30
lines changed

3 files changed

+0
-30
lines changed

action.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,6 @@ type actionDefinition struct {
9292
builtin bool // builtin is based on if the action was in the actions map when it was first initialized.
9393
}
9494

95-
// libraryDefinition defines a 3rd-party actions library that can be imported using the `#import` syntax.
96-
type libraryDefinition struct {
97-
identifier string
98-
// make is the function to call to add the actions in this library to the actions map.
99-
make func(identifier string)
100-
}
101-
10295
var enumerations = map[string][]string{
10396
"measurementUnitType": {"Acceleration", "Angle", "Area", "Concentration Mass", "Dispersion", "Duration", "Electric Charge", "Electric Current", "Electric Potential Difference", "V Electric Resistance", "Energy", "Frequency", "Fuel Efficiency", "Illuminance", "Information Storage", "Length", "Mass", "Power", "Pressure", "Speed", "Temperature", "Volume"},
10497
"storageUnit": {"bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"},
@@ -690,11 +683,6 @@ func generateActionParamDefinition(param parameterDefinition) string {
690683
return definition.String()
691684
}
692685

693-
// makeLibraries makes the library variable, this is where 3rd party action library definitions will start.
694-
func makeLibraries() {
695-
libraries = make(map[string]libraryDefinition)
696-
}
697-
698686
func appIntentDescriptor(intent appIntent) map[string]any {
699687
return map[string]any{
700688
"AppIntentDescriptor": map[string]string{

parser.go

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,6 @@ func parse() {
194194
collectQuestion()
195195
case tokenAhead(Definition):
196196
collectDefinition()
197-
case tokenAhead(Import):
198-
collectImport()
199197
case isChar('@'):
200198
collectVariable(false)
201199
case tokenAhead(Constant):
@@ -898,21 +896,6 @@ func collectBooleanDefinition(key string) {
898896
}
899897
}
900898

901-
// libraries is a map of the 3rd party libraries defined in the compiler.
902-
// The key determines the identifier of the identifier name that must be used in the syntax, it's value defines its behavior, etc. using an libraryDefinition.
903-
var libraries map[string]libraryDefinition
904-
905-
func collectImport() {
906-
makeLibraries()
907-
advanceTimes(2)
908-
var collectedLibrary = collectString()
909-
if lib, found := libraries[collectedLibrary]; found {
910-
lib.make(lib.identifier)
911-
} else {
912-
parserError(fmt.Sprintf("Import library '%s' does not exist!", collectedLibrary))
913-
}
914-
}
915-
916899
var questions map[string]*question
917900

918901
type question struct {

token.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ const (
2727
Menu tokenType = "menu"
2828
Item tokenType = "item"
2929
Definition tokenType = "#define"
30-
Import tokenType = "#import"
3130
Question tokenType = "#question"
3231
Include tokenType = "#include"
3332
Action tokenType = "action"

0 commit comments

Comments
 (0)