From bf17e494fd2047c5fe4224d53dc8b473f28bc0e2 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Sat, 15 Jan 2022 11:01:01 +0800 Subject: [PATCH] fix: variable names containing '_' are not correctly handled --- RedPandaIDE/parser/cpptokenizer.cpp | 2 +- templates/CL_GLUT.template | 2 +- templates/GLFW.template | 2 +- templates/Hello.template | 2 +- templates/OpenGL.template | 2 +- templates/raylib_3d.template | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/RedPandaIDE/parser/cpptokenizer.cpp b/RedPandaIDE/parser/cpptokenizer.cpp index 61084112..f4d35aa1 100644 --- a/RedPandaIDE/parser/cpptokenizer.cpp +++ b/RedPandaIDE/parser/cpptokenizer.cpp @@ -585,7 +585,7 @@ void CppTokenizer::skipToNextToken() bool CppTokenizer::isIdentChar(const QChar &ch) { - return ch.isLetter(); + return ch=='_' || ch.isLetter() ; } void CppTokenizer::advance() diff --git a/templates/CL_GLUT.template b/templates/CL_GLUT.template index e244b924..e9c79c5f 100644 --- a/templates/CL_GLUT.template +++ b/templates/CL_GLUT.template @@ -4,7 +4,7 @@ Name=GLUT Icon=CL_GLUT.ico Description=A simple GLUT program Description[zh_CN]=一个简单的GLUT程序 -Category=Multimedia +Category=3D Category[zh_CN]=3D [Unit0] diff --git a/templates/GLFW.template b/templates/GLFW.template index 5560e0f1..e577055e 100644 --- a/templates/GLFW.template +++ b/templates/GLFW.template @@ -4,7 +4,7 @@ Name=GLFW Description=A simple GLFW program Description[zh_CN]=一个简单的GLFW程序 Icon=GLFW.ico -Category=Multimedia +Category=3D Category[zh_CN]=3D [Unit0] diff --git a/templates/Hello.template b/templates/Hello.template index 904a6fb8..522f468e 100644 --- a/templates/Hello.template +++ b/templates/Hello.template @@ -6,7 +6,7 @@ Icon=Communication.ico Description=A classic Hello World program Description[zh_CN]=一个经典的“世界,你好!”程序 Category=Console -Category=控制台 +Category[zh_CN]=控制台 [Unit0] CName=main.c diff --git a/templates/OpenGL.template b/templates/OpenGL.template index bdabbb3a..3e2f82ee 100644 --- a/templates/OpenGL.template +++ b/templates/OpenGL.template @@ -4,7 +4,7 @@ Name=OpenGL Icon=Pizza.ico Description=A basic OpenGL program Description[zh_CN]=一个基本的OpenGL程序 -Category=Multimedia +Category=3D Category[zh_CN]=3D [Unit0] diff --git a/templates/raylib_3d.template b/templates/raylib_3d.template index 54c24389..176257e7 100644 --- a/templates/raylib_3d.template +++ b/templates/raylib_3d.template @@ -5,7 +5,7 @@ Name[zh_CN]=raylib 3D Icon=raylib.ico Description=A simple 3D program using raylib ( https://raylib.com ) Description[zh_CN]=简单的raylib 3D程序 ( https://raylib.com ) -Category=Multimedia +Category=3D Category[zh_CN]=3D [Unit0]