- Sort Score
- Result 10 results
- Languages All
Results 1 - 8 of 8 for Tokenize (0.54 sec)
-
src/cmd/asm/internal/asm/expr_test.go
} func TestExpr(t *testing.T) { p := NewParser(nil, nil, nil) // Expression evaluation uses none of these fields of the parser. for i, test := range exprTests { p.start(lex.Tokenize(test.input)) result := int64(p.expr()) if result != test.output { t.Errorf("%d: %q evaluated to %d; expected %d", i, test.input, result, test.output) } tok := p.next()
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Tue Aug 29 07:48:38 GMT 2023 - 3.2K bytes - Viewed (0) -
src/cmd/asm/internal/lex/lex.go
type Macro struct { name string // The #define name. args []string // Formal arguments. tokens []Token // Body of macro. } // Tokenize turns a string into a list of Tokens; used to parse the -D flag and in tests. func Tokenize(str string) []Token { t := NewTokenizer("command line", strings.NewReader(str), nil) var tokens []Token for { tok := t.Next() if tok == scanner.EOF { break
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Tue Aug 29 18:31:05 GMT 2023 - 4.1K bytes - Viewed (0) -
src/cmd/asm/internal/lex/input.go
if i > 0 { name, value = name[:i], name[i+1:] } tokens := Tokenize(name) if len(tokens) != 1 || tokens[0].ScanToken != scanner.Ident { fmt.Fprintf(os.Stderr, "asm: parsing -D: %q is not a valid identifier name\n", tokens[0]) flags.Usage() } macros[name] = &Macro{ name: name, args: nil, tokens: Tokenize(value), } } return macros } var panicOnError bool // For testing.
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Tue Aug 29 07:48:38 GMT 2023 - 12.6K bytes - Viewed (0) -
src/cmd/asm/internal/asm/pseudo_test.go
package asm import ( "strings" "testing" "cmd/asm/internal/lex" ) func tokenize(s string) [][]lex.Token { res := [][]lex.Token{} if len(s) == 0 { return res } for _, o := range strings.Split(s, ",") { res = append(res, lex.Tokenize(o)) } return res } func TestErroneous(t *testing.T) { type errtest struct { pseudo string operands string
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Tue Aug 29 07:48:38 GMT 2023 - 3.1K bytes - Viewed (0) -
src/bufio/scan.go
scanCalled bool // Scan has been called; buffer is in use. done bool // Scan has finished. } // SplitFunc is the signature of the split function used to tokenize the // input. The arguments are an initial substring of the remaining unprocessed // data and a flag, atEOF, that reports whether the [Reader] has no more data
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Mon Oct 23 09:06:30 GMT 2023 - 14.2K bytes - Viewed (0) -
src/cmd/asm/internal/asm/operand_test.go
} }() parse() return nil } func testBadOperandParser(t *testing.T, parser *Parser, tests []badOperandTest) { for _, test := range tests { err := tryParse(t, func() { parser.start(lex.Tokenize(test.input)) addr := obj.Addr{} parser.operand(&addr) }) switch { case err == nil: t.Errorf("fail at %s: got no errors; expected %s\n", test.input, test.error)
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Tue Aug 29 18:31:05 GMT 2023 - 23.9K bytes - Viewed (0) -
src/cmd/asm/internal/asm/line_test.go
}) } func testBadInstParser(t *testing.T, goarch string, tests []badInstTest) { for i, test := range tests { arch, ctxt := setArch(goarch) tokenizer := lex.NewTokenizer("", strings.NewReader(test.input+"\n"), nil) parser := NewParser(ctxt, arch, tokenizer) err := tryParse(t, func() { parser.Parse() }) switch { case err == nil:
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Tue Aug 29 07:48:38 GMT 2023 - 1.9K bytes - Viewed (0) -
src/cmd/asm/internal/lex/tokenizer.go
return i > 0 && unicode.IsDigit(ch) } func (t *Tokenizer) Text() string { switch t.tok { case LSH: return "<<" case RSH: return ">>" case ARR: return "->" case ROT: return "@>" } return t.s.TokenText() } func (t *Tokenizer) File() string { return t.base.Filename() } func (t *Tokenizer) Base() *src.PosBase { return t.base }
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Thu Aug 04 20:35:21 GMT 2022 - 3K bytes - Viewed (0)