Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qt-creator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tobias Hunger
qt-creator
Commits
99f23597
Commit
99f23597
authored
16 years ago
by
Thorbjørn Lindeijer
Browse files
Options
Downloads
Patches
Plain Diff
Added license headers to javascriptengine_p.{cpp,h}
Reviewed-by: Roberto Raggi
parent
85325d50
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plugins/qtscripteditor/parser/javascriptengine_p.cpp
+42
-13
42 additions, 13 deletions
src/plugins/qtscripteditor/parser/javascriptengine_p.cpp
src/plugins/qtscripteditor/parser/javascriptengine_p.h
+68
-39
68 additions, 39 deletions
src/plugins/qtscripteditor/parser/javascriptengine_p.h
with
110 additions
and
52 deletions
src/plugins/qtscripteditor/parser/javascriptengine_p.cpp
+
42
−
13
View file @
99f23597
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Qt Software Information (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at qt-sales@nokia.com.
**
**************************************************************************/
#include
"javascriptengine_p.h"
#include
"javascriptnodepool_p.h"
#include
"javascriptvalue.h"
...
...
@@ -10,17 +39,17 @@ namespace JavaScript {
int
Ecma
::
RegExp
::
flagFromChar
(
const
QChar
&
ch
)
{
static
QHash
<
QChar
,
int
>
flagsHash
;
if
(
flagsHash
.
isEmpty
())
{
flagsHash
[
QLatin1Char
(
'g'
)]
=
Global
;
flagsHash
[
QLatin1Char
(
'i'
)]
=
IgnoreCase
;
flagsHash
[
QLatin1Char
(
'm'
)]
=
Multiline
;
}
QHash
<
QChar
,
int
>::
const_iterator
it
;
it
=
flagsHash
.
constFind
(
ch
);
if
(
it
==
flagsHash
.
constEnd
())
return
0
;
return
it
.
value
();
static
QHash
<
QChar
,
int
>
flagsHash
;
if
(
flagsHash
.
isEmpty
())
{
flagsHash
[
QLatin1Char
(
'g'
)]
=
Global
;
flagsHash
[
QLatin1Char
(
'i'
)]
=
IgnoreCase
;
flagsHash
[
QLatin1Char
(
'm'
)]
=
Multiline
;
}
QHash
<
QChar
,
int
>::
const_iterator
it
;
it
=
flagsHash
.
constFind
(
ch
);
if
(
it
==
flagsHash
.
constEnd
())
return
0
;
return
it
.
value
();
}
...
...
@@ -35,8 +64,8 @@ NodePool::~NodePool()
Code
*
NodePool
::
createCompiledCode
(
AST
::
Node
*
,
CompilationUnit
&
)
{
Q_ASSERT
(
0
);
return
0
;
Q_ASSERT
(
0
);
return
0
;
}
static
int
toDigit
(
char
c
)
...
...
This diff is collapsed.
Click to expand it.
src/plugins/qtscripteditor/parser/javascriptengine_p.h
+
68
−
39
View file @
99f23597
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Qt Software Information (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at qt-sales@nokia.com.
**
**************************************************************************/
#ifndef JAVASCRIPTENGINE_P_H
#define JAVASCRIPTENGINE_P_H
...
...
@@ -42,24 +71,24 @@ public:
class
JavaScriptNameIdImpl
{
QString
_text
;
QString
_text
;
public:
JavaScriptNameIdImpl
(
const
QChar
*
u
,
int
s
)
:
_text
(
u
,
s
)
{
}
JavaScriptNameIdImpl
(
const
QChar
*
u
,
int
s
)
:
_text
(
u
,
s
)
{
}
const
QString
asString
()
const
{
return
_text
;
}
const
QString
asString
()
const
{
return
_text
;
}
bool
operator
==
(
const
JavaScriptNameIdImpl
&
other
)
const
{
return
_text
==
other
.
_text
;
}
bool
operator
==
(
const
JavaScriptNameIdImpl
&
other
)
const
{
return
_text
==
other
.
_text
;
}
bool
operator
!=
(
const
JavaScriptNameIdImpl
&
other
)
const
{
return
_text
!=
other
.
_text
;
}
bool
operator
!=
(
const
JavaScriptNameIdImpl
&
other
)
const
{
return
_text
!=
other
.
_text
;
}
bool
operator
<
(
const
JavaScriptNameIdImpl
&
other
)
const
{
return
_text
<
other
.
_text
;
}
bool
operator
<
(
const
JavaScriptNameIdImpl
&
other
)
const
{
return
_text
<
other
.
_text
;
}
};
inline
uint
qHash
(
const
JavaScriptNameIdImpl
&
id
)
...
...
@@ -67,43 +96,43 @@ inline uint qHash(const JavaScriptNameIdImpl &id)
class
JavaScriptEnginePrivate
{
JavaScript
::
Lexer
*
_lexer
;
JavaScript
::
NodePool
*
_nodePool
;
JavaScript
::
AST
::
Node
*
_ast
;
QSet
<
JavaScriptNameIdImpl
>
_literals
;
JavaScript
::
Lexer
*
_lexer
;
JavaScript
::
NodePool
*
_nodePool
;
JavaScript
::
AST
::
Node
*
_ast
;
QSet
<
JavaScriptNameIdImpl
>
_literals
;
public:
JavaScriptEnginePrivate
()
:
_lexer
(
0
),
_nodePool
(
0
),
_ast
(
0
)
{
}
JavaScriptEnginePrivate
()
:
_lexer
(
0
),
_nodePool
(
0
),
_ast
(
0
)
{
}
QSet
<
JavaScriptNameIdImpl
>
literals
()
const
{
return
_literals
;
}
QSet
<
JavaScriptNameIdImpl
>
literals
()
const
{
return
_literals
;
}
JavaScriptNameIdImpl
*
intern
(
const
QChar
*
u
,
int
s
)
{
return
const_cast
<
JavaScriptNameIdImpl
*>
(
&*
_literals
.
insert
(
JavaScriptNameIdImpl
(
u
,
s
)));
}
JavaScriptNameIdImpl
*
intern
(
const
QChar
*
u
,
int
s
)
{
return
const_cast
<
JavaScriptNameIdImpl
*>
(
&*
_literals
.
insert
(
JavaScriptNameIdImpl
(
u
,
s
)));
}
JavaScript
::
Lexer
*
lexer
()
const
{
return
_lexer
;
}
JavaScript
::
Lexer
*
lexer
()
const
{
return
_lexer
;
}
void
setLexer
(
JavaScript
::
Lexer
*
lexer
)
{
_lexer
=
lexer
;
}
void
setLexer
(
JavaScript
::
Lexer
*
lexer
)
{
_lexer
=
lexer
;
}
JavaScript
::
NodePool
*
nodePool
()
const
{
return
_nodePool
;
}
JavaScript
::
NodePool
*
nodePool
()
const
{
return
_nodePool
;
}
void
setNodePool
(
JavaScript
::
NodePool
*
nodePool
)
{
_nodePool
=
nodePool
;
}
void
setNodePool
(
JavaScript
::
NodePool
*
nodePool
)
{
_nodePool
=
nodePool
;
}
JavaScript
::
AST
::
Node
*
ast
()
const
{
return
_ast
;
}
JavaScript
::
AST
::
Node
*
ast
()
const
{
return
_ast
;
}
JavaScript
::
AST
::
Node
*
changeAbstractSyntaxTree
(
JavaScript
::
AST
::
Node
*
node
)
{
JavaScript
::
AST
::
Node
*
previousAST
=
_ast
;
_ast
=
node
;
return
previousAST
;
}
JavaScript
::
AST
::
Node
*
changeAbstractSyntaxTree
(
JavaScript
::
AST
::
Node
*
node
)
{
JavaScript
::
AST
::
Node
*
previousAST
=
_ast
;
_ast
=
node
;
return
previousAST
;
}
};
QT_END_NAMESPACE
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment