Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for _EOF (0.55 sec)

  1. src/cmd/compile/internal/syntax/testing.go

    // the comment text; otherwise it is the error message.
    func CommentsDo(src io.Reader, handler func(line, col uint, text string)) {
    	var s scanner
    	s.init(src, handler, comments)
    	for s.tok != _EOF {
    		s.next()
    	}
    }
    
    // CommentMap collects all comments in the given src with comment text
    // that matches the supplied regular expression rx and returns them as
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 17 19:53:18 UTC 2023
    - 2.1K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/syntax/token_string.go

    package syntax
    
    import "strconv"
    
    func _() {
    	// An "invalid array index" compiler error signifies that the constant values have changed.
    	// Re-run the stringer command to generate them again.
    	var x [1]struct{}
    	_ = x[_EOF-1]
    	_ = x[_Name-2]
    	_ = x[_Literal-3]
    	_ = x[_Operator-4]
    	_ = x[_AssignOp-5]
    	_ = x[_IncOp-6]
    	_ = x[_Assign-7]
    	_ = x[_Define-8]
    	_ = x[_Arrow-9]
    	_ = x[_Star-10]
    	_ = x[_Lparen-11]
    	_ = x[_Lbrack-12]
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Dec 29 02:28:24 UTC 2020
    - 1.7K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/syntax/scanner_test.go

    				continue
    			}
    			if got.lit != "newline" {
    				t.Errorf("%s: got %s; want newline", src, got.lit)
    			}
    		}
    
    		got.next()
    	}
    
    	if got.tok != _EOF {
    		t.Errorf("got %q; want _EOF", got.tok)
    	}
    }
    
    var sampleTokens = [...]struct {
    	tok  token
    	src  string
    	op   Operator
    	prec int
    }{
    	// name samples
    	{_Name, "x", 0, 0},
    	{_Name, "X123", 0, 0},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 14 16:11:21 UTC 2022
    - 21.9K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/syntax/tokens.go

    // license that can be found in the LICENSE file.
    
    package syntax
    
    type Token uint
    
    type token = Token
    
    //go:generate stringer -type token -linecomment tokens.go
    
    const (
    	_    token = iota
    	_EOF       // EOF
    
    	// names and literals
    	_Name    // name
    	_Literal // literal
    
    	// operators and operations
    	// _Operator is excluding '*' (_Star)
    	_Operator // op
    	_AssignOp // op=
    	_IncOp    // opop
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 20 14:52:38 UTC 2023
    - 2.6K bytes
    - Viewed (0)
  5. src/cmd/vendor/golang.org/x/mod/modfile/read.go

    type tokenKind int
    
    const (
    	_EOF tokenKind = -(iota + 1)
    	_EOLCOMMENT
    	_IDENT
    	_STRING
    	_COMMENT
    
    	// newlines and punctuation tokens are allowed as ASCII codes.
    )
    
    func (k tokenKind) isComment() bool {
    	return k == _COMMENT || k == _EOLCOMMENT
    }
    
    // isEOL returns whether a token terminates a line.
    func (k tokenKind) isEOL() bool {
    	return k == _EOF || k == _EOLCOMMENT || k == '\n'
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 02:38:00 UTC 2024
    - 23.1K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/syntax/parser.go

    		// since comments before may set pragmas for the next function decl.
    		p.clearPragma()
    
    		if p.tok != _EOF && !p.got(_Semi) {
    			p.syntaxError("after top level declaration")
    			p.advance(_Import, _Const, _Type, _Var, _Func)
    		}
    	}
    	// p.tok == _EOF
    
    	p.clearPragma()
    	f.EOF = p.pos()
    
    	return f
    }
    
    func isEmptyFuncDecl(dcl Decl) bool {
    	f, ok := dcl.(*FuncDecl)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 62.9K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/syntax/error_test.go

    		}
    	}, comments)
    
    	// consume file
    	for {
    		s.next()
    		if pattern != "" {
    			declared[position{s.line, s.col}] = pattern
    			pattern = ""
    		}
    		if s.tok == _EOF {
    			break
    		}
    	}
    
    	return declared
    }
    
    func testSyntaxErrors(t *testing.T, filename string) {
    	declared := declaredErrors(t, filename)
    	if *print {
    		fmt.Println("Declared errors:")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 20 02:13:02 UTC 2022
    - 4.8K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/syntax/printer.go

    		linebreaks: form == 0,
    	}
    
    	defer func() {
    		n = p.written
    		if e := recover(); e != nil {
    			err = e.(writeError).err // re-panics if it's not a writeError
    		}
    	}()
    
    	p.print(x)
    	p.flush(_EOF)
    
    	return
    }
    
    // String is a convenience function that prints n in ShortForm
    // and returns the printed string.
    func String(n Node) string {
    	var buf strings.Builder
    	_, err := Fprint(&buf, n, ShortForm)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Aug 24 07:17:27 UTC 2023
    - 21.5K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/syntax/scanner.go

    		s.nextch()
    		s.ident()
    		return
    	}
    
    	switch s.ch {
    	case -1:
    		if nlsemi {
    			s.lit = "EOF"
    			s.tok = _Semi
    			break
    		}
    		s.tok = _EOF
    
    	case '\n':
    		s.nextch()
    		s.lit = "newline"
    		s.tok = _Semi
    
    	case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9':
    		s.number(false)
    
    	case '"':
    		s.stdString()
    
    	case '`':
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 28 18:17:41 UTC 2022
    - 17.1K bytes
    - Viewed (0)
Back to top