Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我的词法分析器的定义部分定义一些标识符时(如此处所述),我正在尝试编写以下形式的内容:
let op_char = ['+' '-' '*' '/'] let id_char = [^ ' ' '\r' '\n' '\t' op_char]
将 id_char 定义为不是空白字符或 op_char 的每个字符。但是,我在第二行的“op_char”上收到语法错误。我该怎么写这个?谢谢。
let id_char = [^ ' ' '\r' '\n' '\t'] # op_char
见手册。