Merge pull request #730 from xushiwei/q

llgocppg ast/token
This commit is contained in:
xushiwei
2024-08-20 09:05:48 +08:00
committed by GitHub
2 changed files with 20 additions and 15 deletions

View File

@@ -16,9 +16,7 @@
package ast
import (
"github.com/goplus/llgo/chore/llcppg/token"
)
import "github.com/goplus/llgo/chore/llcppg/token"
// =============================================================================
@@ -48,11 +46,6 @@ type PPD interface { // preprocessing directive
// =============================================================================
// Expressions (Types are also expressions)
type Token struct {
Token token.Token
Lit string
}
type BasicLitKind uint
const (
@@ -69,6 +62,8 @@ type BasicLit struct {
func (*BasicLit) exprNode() {}
// ------------------------------------------------
type TypeKind uint
const (
@@ -308,9 +303,14 @@ func (*Include) ppdNode() {}
// ------------------------------------------------
type Token struct {
Token token.Token
Lit string
}
type Macro struct {
Name string
Info []*Token
Name string
Tokens []*Token // Tokens[0].Lit is the macro name
}
func (*Macro) ppdNode() {}