不论关键字

huangapple go评论100阅读模式
英文:

notwithstanding keyword

问题

notwithstanding关键字在Google Go中的含义是什么?

英文:

What does the notwithstanding keyword mean in Google Go?

答案1

得分: 45

看起来对我来说是词法分析器中的彩蛋:

https://github.com/golang/go/blob/08e25fc1ba397e02ec776561ed73b7f9a8b94392/src/cmd/compile/internal/gc/lex.go#L2152-L2156

相关部分是符号表:

"notwithstanding",      LIGNORE,	Txxx,		OXXX,
"thetruthofthematter",  LIGNORE,	Txxx,		OXXX,
"despiteallobjections", LIGNORE,	Txxx,		OXXX,
"whereas",              LIGNORE,	Txxx,		OXXX,
"insofaras",            LIGNORE,	Txxx,		OXXX,

我猜它们可以用来测试对词法类型 LIGNORE 的处理,但似乎没有任何“真正”的被忽略的标记。

英文:

2017 Update: There was a major parser update and the new one no longer seems to support these Easter egg words.


Looks like an easter egg in the lexer to me:

https://github.com/golang/go/blob/08e25fc1ba397e02ec776561ed73b7f9a8b94392/src/cmd/compile/internal/gc/lex.go#L2152-L2156

the relevant section is the symbol table:

"notwithstanding",      LIGNORE,	Txxx,		OXXX,
"thetruthofthematter",  LIGNORE,	Txxx,		OXXX,
"despiteallobjections", LIGNORE,	Txxx,		OXXX,
"whereas",              LIGNORE,	Txxx,		OXXX,
"insofaras",            LIGNORE,	Txxx,		OXXX,

I guess they could be used to test handling of the lexical type LIGNORE, but there doesn't seem to be any "real" ignored tokens.

答案2

得分: 8

Go编程语言规范中不包括关键字'notwithstanding'。

英文:

The Go Programming Language Specification does not include the keyword 'notwithstanding'.

huangapple
  • 本文由 发表于 2010年3月22日 11:00:43
  • 转载请务必保留本文链接:https://go.coder-hub.com/2489803.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定