Renamed returnsTo to returnees
This commit is contained in:
parent
d8c0ce8d28
commit
ef9d518032
@ -215,15 +215,15 @@ func (phrase Phrase) Argument (index int) (argument Argument) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReturnsToLength returns the amount of things the phrase returns to.
|
// ReturneesLength returns the amount of things the phrase returns to.
|
||||||
func (phrase Phrase) ReturnsToLength () (length int) {
|
func (phrase Phrase) ReturneesLength () (length int) {
|
||||||
length = len(phrase.returnsTo)
|
length = len(phrase.returnees)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReturnTo returns the thing alskdjaslkdjsa whatever i dont even know wtf.
|
// Returnee returns the returnee at index.
|
||||||
func (phrase Phrase) ReturnTo (index int) (returnTo Argument) {
|
func (phrase Phrase) Returnee (index int) (returnee Argument) {
|
||||||
returnTo = phrase.returnsTo[index]
|
returnee = phrase.returnees[index]
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,29 +3,6 @@ package parser
|
|||||||
import "git.tebibyte.media/arf/arf/lexer"
|
import "git.tebibyte.media/arf/arf/lexer"
|
||||||
import "git.tebibyte.media/arf/arf/infoerr"
|
import "git.tebibyte.media/arf/arf/infoerr"
|
||||||
|
|
||||||
// TODO: need to come up with another syntax for bitfields, and use that syntax
|
|
||||||
// for fixed-length arrays. the problem is, we cant use {} for those kinds of
|
|
||||||
// arrays because they aren't pointers under the hood and that goes against the
|
|
||||||
// arf design goals in a nasty ugly way, and not only that. but the :mut type
|
|
||||||
// qualifier is meaningless on fixed length arrays now. the bit field syntax
|
|
||||||
// solves both of these problems very gracefully. but now, the problem is coming
|
|
||||||
// up with new bit field syntax. implementing this change is extremely
|
|
||||||
// necessary, for it will supercharge the coherency of the language and make it
|
|
||||||
// way more awesome.
|
|
||||||
//
|
|
||||||
// this new syntax cannot conflict with arguments, so it cannot have any
|
|
||||||
// tokens that begin those. basically all symbol tokens are on the table here.
|
|
||||||
// some ideas:
|
|
||||||
//
|
|
||||||
// ro member:Type ~ 4
|
|
||||||
// ro member:Type & 4 <- i like this one because binary &. so intuitive.
|
|
||||||
// ro member:Type % 4
|
|
||||||
// ro member:Type | 4
|
|
||||||
// ro member:Type ! 4
|
|
||||||
// ro member:Type (4) <- this looks phenomenal, but it needs new tokens not
|
|
||||||
// used anywhere else, and it would be mildly annoying
|
|
||||||
// to parse.
|
|
||||||
|
|
||||||
// parseType parses a type notation of the form Name, {Name}, etc.
|
// parseType parses a type notation of the form Name, {Name}, etc.
|
||||||
func (parser *ParsingOperation) parseType () (what Type, err error) {
|
func (parser *ParsingOperation) parseType () (what Type, err error) {
|
||||||
err = parser.expect(lexer.TokenKindName, lexer.TokenKindLBrace)
|
err = parser.expect(lexer.TokenKindName, lexer.TokenKindLBrace)
|
||||||
|
@ -202,11 +202,11 @@ func (parser *ParsingOperation) parseBlockLevelPhrase (
|
|||||||
// ...until we hit a newline
|
// ...until we hit a newline
|
||||||
if parser.token.Is(lexer.TokenKindNewline) { break }
|
if parser.token.Is(lexer.TokenKindNewline) { break }
|
||||||
|
|
||||||
var returnTo Argument
|
var returnee Argument
|
||||||
returnTo, err = parser.parseArgument()
|
returnee, err = parser.parseArgument()
|
||||||
if err != nil { return }
|
if err != nil { return }
|
||||||
|
|
||||||
phrase.returnsTo = append(phrase.returnsTo, returnTo)
|
phrase.returnees = append(phrase.returnees, returnee)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -421,9 +421,9 @@ func (phrase Phrase) ToString (indent int, ownLine bool) (output string) {
|
|||||||
}
|
}
|
||||||
output += "]"
|
output += "]"
|
||||||
|
|
||||||
if len(phrase.returnsTo) > 0 {
|
if len(phrase.returnees) > 0 {
|
||||||
output += " ->"
|
output += " ->"
|
||||||
for _, returnItem := range phrase.returnsTo {
|
for _, returnItem := range phrase.returnees {
|
||||||
output += " " + returnItem.ToString(0, false)
|
output += " " + returnItem.ToString(0, false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -262,9 +262,7 @@ type Phrase struct {
|
|||||||
location file.Location
|
location file.Location
|
||||||
command Argument
|
command Argument
|
||||||
arguments []Argument
|
arguments []Argument
|
||||||
// TODO: this is wack. it should be named after a plural noun like,
|
returnees []Argument
|
||||||
// returnees or something. accessor methods should beupdated to match.
|
|
||||||
returnsTo []Argument
|
|
||||||
|
|
||||||
kind PhraseKind
|
kind PhraseKind
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user