Google Go:尽管有关键字 [英] Google Go: notwithstanding keyword

查看:128
本文介绍了Google Go:尽管有关键字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Google Go中,尽管关键字的意思是什么?

解决方案

2017更新:有一个主要的解析器更新,新的似乎不再支持这些复活节彩蛋词语。




看起来像词法分析器中的复活节彩蛋:

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



相关部分是符号表:

 尽管,LIGNORE,Txxx,OXXX,
thetruthofthematter,LIGNORE,Txxx,OXXX,
尽管有反对意见,LIGNORE,Txxx,OXXX ,
而,LIGNORE,Txxx,OXXX,
insofaras,LIGNORE,Txxx, OXXX,

我猜他们可以用来测试词法类型LIGNORE的处理,但是没有' t似乎是任何真正的被忽略的令牌。


What does the notwithstanding keyword mean in Google Go?

解决方案

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.

这篇关于Google Go:尽管有关键字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆