Comments (1)
When parsing C, I have taken on this convention to strip all comments and cleanup the lines before parsing:
dat.seek(0) # so it may be read multiple times
InlineReg = "/\*((?!\*/).)*\*/" # filter out inline comments
ldat = dat.readlines()
for l in ldat:
comment = l.rfind("//")
# double slash terminates line basically
if comment:
l = l[:comment]
# remove inline comments from line
l = re.sub(InlineReg, "", l)
# do processing here
This sort of thing can be added easily to a utility function if needed to remove comments. Multi line comments and macros are not caught here either, but those will require a much more complicated parser.
from fast64.
Related Issues (20)
- 'Material' has no attribute 'rdp_settings' HOT 9
- Getting start (and end) addresses of a GeoLayout for binary export HOT 1
- SyntaxError: when installing HOT 2
- "Cannot unpack non-iterable FImageKey object" HOT 2
- "Cannot find level empty" Error when exporting levels? HELP HOT 2
- How do i get "mario_skel.blend"? HOT 3
- ImportError? HOT 3
- Warn in object inspector on negative scale
- Question: Ship of Harkinian support? HOT 3
- Error: armature_002-switch_option.001 has no mesh children.
- Groups of the bad vert that don't correspond to a bone: ['000-displaylist'] HOT 1
- Oot map importer segments are bugged (FOUND WORKAROUND) HOT 6
- idk HOT 1
- Too many connecting vertices in skinned triangles
- Issues with Exporting "LowPolySkinnedMarioV5".blend into SM64
- Error on exporting insertable binary. HOT 1
- I Cant make a fast3d material. (python error and crash) HOT 3
- Can´t install on Blender 3.6 HOT 2
- [OoT] Importing Player animations causes an error HOT 1
- [OoT] Unfriendly error when exporting a room without geometry
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fast64.