Skip to content

Commit

Permalink
Merge pull request #116 from ourPLCC/include
Browse files Browse the repository at this point in the history
feat: add %include
  • Loading branch information
StoneyJackson authored Apr 20, 2024
2 parents dd27f16 + 1c74d39 commit 21022df
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/plcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,7 @@ def done():
def nextLine():
# create a generator to get the next line in the current input file
global Lno, Fname, Line
global stack # used for '#include ...' processing
global stack # used for '%include ...' processing
global argv # file arguments
global nlgen # next line generator for Fname
maxStack = 4 # maximum #include stacking level
Expand Down Expand Up @@ -1059,9 +1059,9 @@ def nextLine():
if lineMode:
pass # don't process #include directives when in line mode
else:
if Line[:8] == '#include':
if Line[:8] in ['#include', '%include']:
ary = Line.split(None, maxsplit = 1)
if len(ary) == 2 and ary[0] == '#include':
if len(ary) == 2 and ary[0] in ['#include', '%include']:
if len(stack) >= maxStack:
death('max #include nesting depth exceeded')
debug('include directive: {} {}'
Expand Down

0 comments on commit 21022df

Please sign in to comment.